summaryrefslogtreecommitdiff
path: root/automotive/vehicle/aidl/impl/utils/common/src
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-08-12Use a different timesource in recurrent timer.Yu Shan
Previously we used elapsedRealtimeNanos in recurrent timer which will still go even if the system is in deep sleep. This causes all the events "happened" during suspension to be replayed immediately after the wake up, which causes a spam of messages. uptimeNanos meanwhile, does not go if the system is in sleep, so we use that instead. Test: atest VehicleHalVehicleUtilsTest Bug: 235262127 Change-Id: Ib67c2e2251af3231cefd875416d5bcb15953ba5e Merged-In: Ib67c2e2251af3231cefd875416d5bcb15953ba5e (cherry picked from commit 5e508737934feb595c841430f41b5edb1d1925d5)
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-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
2022-01-20Support subscribe/unsubscribe in VHAL.Yu Shan
Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I4e7b31af7fa2af445f9bac6ec71dad3bf6c0b8b3
2021-12-28Add checkPropValue in VehicleUtils.Yu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 200737967 Change-Id: I0e6eed7d085af2a45448efa845e3e8f66c0a84ce
2021-10-25Add vendor override property to fake VHAL hardware.Yu Shan
Allow vendor to override default properties in fake VHAL hardware. Test: atest FakeVehicleHardwareTest Bug: 201830716 Change-Id: Ie6061d7a8123e3b22c6fa467639f1fe77dec222c
2021-10-20Migrate fake value generator hub.Yu Shan
Migrate fake value generator hub. This CL also turns all exising LockGuard to ScopedLock. Test: atest FakeVehicleHalValueGeneratorsTest Bug: 201830716 Change-Id: I3ce64792fa5a49ae5e11e1fc5636a30221c596e6
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-21Migrate VehiclePropertyStore.Yu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 199337732 Change-Id: Ia18699a0115fdb004c57c0e6fb02b043ddb138b5