summaryrefslogtreecommitdiff
path: root/automotive/vehicle/aidl/impl/utils/common/test
AgeCommit message (Collapse)Author
2022-12-09Avoid holding lock while calling recurrent actions.Yu Shan
This CL fixes a dead lock issue caused by RecurrentTimer holding internal locks while calling actions. The dead lock is caused by the following situation: 1. Caller holds a lock, call RecurrentTimer.registerCallback which waits for RecurrentTimer's lock. 2. Another recurrent action happens at the same time. Recurrent timer holds lock before calling the client action. The client action is now waiting for the lock that is currently hold by 1. Test: atest RecurrentTimerTest Bug: 255574557 Change-Id: I3999f4e9cdf581cb851d5f49341dbcc0c160f234 (cherry picked from commit 93a821077effec224d3880875d98c13ef1787e4c)
2022-07-01Add EventMode to VehiclePropertyStore writeValue.Yu Shan
Add an option to specify whether to trigger onpropertychange callback when VehiclePropertyStore.writeValue is called. Test: atest VehiclePropertyStoreTest Bug: 237318964 Change-Id: Iefd572c96f67dab2ecd5de56acf2e0d1c9b58939
2022-04-06Update subscription logic for VHAL ref impl.Yu Shan
Update the implementation for subscription logic. Add clearer documentation for sampleRate and timestamp behavior. The sampleRate specified in subscribeOptions is just a guidance to tell VHAL what the polling rate could be. For timestamp, the timestamp returned for each property must be the timestamp when that property is updated, not when the property is retrieved. Test: atest FakeVehicleHardwareTest Bug: 225191802, 226000926 Change-Id: I1e886133258236eedfa7fcffe5c4fb49aead4f6f
2022-03-04Define VhalResult alias.Yu Shan
Define a VhalResult alias to represent Result that contains a VHAL StatusCode as error type. This alias helps client to easier migrate from android::base::Result to VhalResult. Test: Presubmit Bug: 219612366 Change-Id: I17f15044ee962c7148b0adc3925e0b0a9dfab2a8
2022-03-03Define custom error type for StatusCode.Yu Shan
Define a wrapper class for StatusCode to be used as E in Result<T, E>. By default E is errorno as defined in linux and does not print out the correct error message. Migrate existing Result usage in VHAL to Result<T, VhalError>. Test: atest VehicleUtilsTest Bug: 219612366 Change-Id: Ic5369b6035bc46afc4c61da26c4b50f7fa9969d8
2022-02-25Improve test coverage for FakeValueGenerator.Yu Shan
Bug: None Test: atest FakeVehicleHalValueGeneratorsTest Change-Id: I6df508e148ff0348fc28b467b4e5a70cf5727a27 Merged-In: I6df508e148ff0348fc28b467b4e5a70cf5727a27 (cherry picked from commit 6ae468c1e39f72456416697ee7cf483dcf0c6f3b)
2022-02-09Make VehicleHalUtils vendor available.Yu Shan
Test: Presubmit Bug: 214635003 Change-Id: I402725599ec22574ed2bd5620e9b9328ff1800f4
2022-01-31Rename VehicleHalUtils to VehicleHalUtilsVendor.Yu Shan
Rename the existing vendor version VehicleHalUtils to VehicleHalUtils vendor and then create a non-vendor version of VehicleHalUtils. Test: Presubmit Bug: 214635003 Change-Id: I7717d2e9527b9dd8592bbdff152aab4ef1b80a10
2022-01-25Move PendingRequestPool and ParcelableUtils.Yu Shan
Move PendingRequestPool and ParcelableUtils to utils so that we could reuse it for cpp VHAL client. This CL also fixes a bug that the comment for PendingRequestPool timeout unit is incorrect. Test: atest VehicleHalVehicleUtilsTest Bug: 214635003 Change-Id: Ie8ac1e0c4f49ae70caff7b680a7352fc23d4e680
2021-12-28Add checkPropValue in VehicleUtils.Yu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 200737967 Change-Id: I0e6eed7d085af2a45448efa845e3e8f66c0a84ce
2021-10-20Migrate ConcurrentQueue.Yu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 201830716 Change-Id: I78671befd8351f17bf3da43372ec302e106690de
2021-10-19Add error code to VeiclePropertyStore.Yu Shan
Add error code to differentiate between different error cases, e.g. when the value is not configured v.s. the value is not set. Test: atest VehicleHalVehicleUtilsTest Bug: 201830716 Change-Id: I1ef0716edce5bc72e07a769026769a330b4e3025
2021-10-19Add on-value-change callback to propstore.Yu Shan
Add on-value-change callback to VehiclePropertyStore. When a new value is written to propStore or a value is updated, the callback would be invoked which could be used to inform VHAL client about value updates. Test: atest VehicleHalVehicleUtilsTest Bug: 201830716 Change-Id: I980f5e8c34d9f872f962776859de9615ce3bf690
2021-10-13Use ObjectPool objects in property store.Yu Shan
Use object pool recyclable objects in property store API to improve code efficiency. This would reduce the number of unnecssary copy of property values. This CL also adds a upateStatus option which by default is set to false, so property from client would not override the property status. Test: atest VehicleHalVehicleUtilsTest Bug: 200737967 Change-Id: Ie96a41ee441e085e10ad1059b67c708ff7173ae0
2021-09-13Migrate VehicleObjectPoolYu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: I93772c401dc077f1fbab79e302336494039308d1
2021-09-27Change unit test suites to device tests.Yu Shan
Since VHAL is not supposed to run on all devices, only auto targets, we change the test suites to device-tests. This also prevents the unit tests to be run against an incompatible version of vendor image, which causes test breakage. Bug: 201009483 Test: presubmits Change-Id: I8878ce6f8200dbc4a3247258f835e980fbaa2028
2021-09-21Migrate VehiclePropertyStore.Yu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: Ia18699a0115fdb004c57c0e6fb02b043ddb138b5
2021-09-21Add VehicleHal utilities.Yu Shan
Add some utility functions to AIDL VHAL. Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: I9e74161efecf7c66caa2f52177fbdd43cdc9d68b