summaryrefslogtreecommitdiff
path: root/src/rust/event_manager
AgeCommit message (Collapse)Author
2022-05-05Fuzz some UciNotifications sending back from HAL to UCI layer.ziyiw
Three of seven notifications are fuzzed. Additionally, fixed the bug that calling Enable and Disable commends would cause panic. Test: manual Bug: 202531943 Change-Id: I9a40f6aaa797646f3bccab9650f37dde67273760
2022-04-14uwb(uci-rust): Reorganize unit test codebaseRoshan Pius
i. Move all Mocks to separate files. ii. Add #cfg(tests) or #cfg(tests, fuzzing) for all mocks. Bug: 229275354 Test: make uwb_uci_rust_fuzzer libuwb_uci_rust_tests Change-Id: Id6bc6631d034112a7f0aa603b120184a01da046d
2022-04-07Create basic fuzz tests.ziyiw
Create a mock adaptation to send mock JNICommand to lower level without triggering HAL. Only SessionInit command is implemented now. More commands are to be added. Test: adb shell /data/fuzz/$(get_build_var TARGET_ARCH)/uwb_uci_rust_fuzzer/uwb_uci_rust_fuzzer Bug: 202531943 Change-Id: I446aec2318869073444cb36ecae085a9153531f9
2022-03-29event_manager: avoid expect() when failed to convert dataChih-Yu Huang
expect() would crash the process in failed case. This CL avoids using expect(), and return Error::JniCall(JniError::Unknown) gracefully. Bug: 227263938 Test: mmm external/uwb Change-Id: I846eaa6a694af501561797b5401f5ac3f9f5991b
2022-03-29uwb_uci_packets: change ControleeStatus's status type to ↵Chih-Yu Huang
MulticastUpdateStatusCode According to the UCI spec, ControleeStatus's status field is the MulticastUpdateStatusCode enum, not a simple u8 value. This CL updates the type of the field. Bug: 227263938 Test: atest libuwb_uci_rust_tests Test: mmm external/uwb Change-Id: I1d764fc27682a24366f70744eb39a478fe0cdf20
2022-02-11uwb(uci-rust): Fix Vendor Rsp/Ntf UCI packet heirarchyRoshan Pius
This ensures that we always have a fully parsed packet as the payload for the rsp/notification enums. Bug: b/202760099 Test: Unit tests Change-Id: Ifd5148707ecefef7c3c683a586700f9938d21b40
2022-02-08uci-rust: add MockEventManager implementationChih-Yu Huang
This CL fills the implementation of MockEventManager that could verify if the expected methods are called or not. Bug: 216552887 Test: atest --host libuwb_uci_rust_tests Change-Id: I12aec1e7fc9ea30d582f2f0c0a5d3558582395a2
2022-02-02[lints] Make clippy compliant + enforcedMatthew Maurer
Bug: 217415765 Test: build Change-Id: Ic4f33810349f44da8b683f32ada2c857b37eda82
2022-02-02[lints] Misc test lint fixesMatthew Maurer
Bug: 217415765 Test: build Change-Id: I41230d104bad13c74a93413ceb1dcfdf47f6f6c5
2022-02-02[lints] Handle all errorsMatthew Maurer
Also prevents errors in drive_once from stopping the whole driver Bug: 217415765 Test: build Change-Id: I405b615dc7f59ca69affb531ca9ec6bbd40206b5
2022-02-02[lints] Remove unused mutMatthew Maurer
Bug: 217415765 Test: build Change-Id: Idb552167e298da4227a76a3d1649f706f615e1ee
2022-02-02[lints] Remove or tag unused variablesMatthew Maurer
Also caught issue where `env` was being recomputed rather than used from parameters. Bug: 217415765 Test: build Change-Id: I6d2d53b0d6f3b426bbc0c42246639e58eb08e1a7
2022-02-02[lints] Remove unused importsMatthew Maurer
Bug: 217415765 Test: build Change-Id: I2caa61854520609f37ae3013d04db3ef37bbcc47
2022-01-28Merge "uci-rust: Rename the traits/implementation/mock of EventManger"TreeHugger Robot
2022-01-27uwb(uci-rust): Merge UCI stack with Android S AOSP stackRoshan Pius
Bug: 196225233 Test: Compiles Change-Id: I19ce090730f3533fffa460bef6b3e27192c079d0
2022-01-27uci-rust: Rename the traits/implementation/mock of EventMangerChih-Yu Huang
This CL renames the EventManger-related type. Such as: - Trait: EventManger - Implementation: EventMangerImpl - Mock: MockEventManager Bug: 216552887 Test: atest --host libuwb_uci_rust_tests_host Change-Id: I349c799f3547e4c0ba38194f95154318f1fd688c
2022-01-26uwb(uci-rust): Implement vendor uci cmd/rsp/ntfRoshan Pius
The various vendor GIDs need to be handled by different packets in the PDL because of inherent limitations. So, there is no way for us to create a base vendor cmd/rsp/ntf packet. Bug: 210933436 Test: Compiles Change-Id: I9c290723441bb69d50dd6bae1a99e91574211e33
2022-01-25uwb(uci-rust): Use {Packet} instead of {Packet}BuilderRoshan Pius
The {Packet} struct should be used for parsed data. Also, made all EventManager method names consistent with "_received". Test: UwbManagerTest, adb shell cmd uwb start-fira-ranging-session Bug: 197341298 Change-Id: I9b08c43bb05254f01c495e53b630c96f323518ee
2022-01-21Added a new trait which is implemented by EventManager and EventManagerTest.Shreshta Manu
Dispatcher can now be initialized from unit tests. Test: libuwb_uci_rust_tests Bug: 197341298 Change-Id: I20b4c39ee9e98bb5f16f15405f9064207615de7d
2022-01-21Fixing minor typosAlain Michaud
This change contains no functional changes Test: Built Change-Id: Id6560cd61b68e88dabb9308e98449c5589a19a26
2022-01-19Handle multicast list update status notificationShreshta Manu
Bug: 197341298 Test: Manual test by forcing multicast list update status ntf Change-Id: I35aedd5ad12943fe8e1c9bc4856c45db799d6b65
2022-01-18uwb(jni-rust): Cache classloader for creating uwb class objectsRoshan Pius
This is needed for invoking jni callbacks from the native thread which needs to pass uwb class objects. Use the infra to implement the range data notifications for short mac address and extended mac address. Bug: 197341298 Test: Manual verification by invoking the callback (ag/16659743). Change-Id: I6df679c09391bde43d1aba2c5ab9e38e995f5c92
2022-01-17uwb(pdl): Some minor fixes/renames in PDLRoshan Pius
Bug: 197341298 Test: atest libuwb_uci_packet_tests Change-Id: I23d04ab55d9344eee2ecd77c395592c764236def
2022-01-14Handle Uci notification packets sent from Uwb chipShreshta Manu
Added handlers for device status, generic error and session status notification and send it to java layer Test: Manually sent notificaitons and verifed data in NativeUwbManager.java Bug: 197341298 Change-Id: I09ee0d2eb96ab8eabffc2747495ffe4b4e9a5971
2021-12-20Add code to call back to the JNI.Joel Galenson
This adds some infrastructure for calling back into the JNI. It implements three of the five callbacks we need. Note that it cannot yet be called as we have not yet initialized the Java class to handle initializations. As the long TODO suggests, we should potentially reconsider how we attach to the thread once we have a better sense of how this is used and what its performance is. Bug: 197341298 Test: Manually insert code that calls it. Test: Manually modify Java callbacks to throw an Exception. Change-Id: I72f231096e44e2f1db33cf6f467ecb662f986d3d