summaryrefslogtreecommitdiff
path: root/automotive/vehicle/aidl/impl/utils/common/include
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-27Added missing mirror area type HVAC propertiesTyler Trephan
Test: atest CarPropertyManagerTest Bug: 237610879 Change-Id: Ibff9b429110ee72f28b109ac193df21ad395de51
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-04Clean up resource correctly when client died.Yu Shan
Add proper lock to make sure that all resources would be cleaned up for a client if the client died. Also add check and not to allocate resources for an already dead client. Test: atest DefaultVehicleHalTest. Run manually and do not see 'failed to call callback' messages. Bug: 221500501 Change-Id: I1c799a6234017b976e7776537ab91526e785b9b4
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-03Remove full namespace in header file.Yu Shan
Test: Presubmit. Bug: 215443397 Change-Id: If8d3556e06119d12f515dc68a591e0f342761d6f
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
2022-01-19Add subscription manager.Yu Shan
Add a class to manage VHAL subscription. It supports subscribing and unsubscribing to properties. For continuous property, it uses recurrent timer to recurrently calls the registered function. For on-change property, it would return all subscribed clients for a given property. Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I3e1a0401fd465dc31fe08ea77d5a6651fa7bbfaf
2021-12-28Implement setValues in DefaultVHAL.Yu Shan
Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: I702d139d2f1c0eb647559dde88deb0486c986c66
2021-12-28Add checkPropValue in VehicleUtils.Yu Shan
Test: atest VehicleHalVehicleUtilsTest Bug: 200737967 Change-Id: I0e6eed7d085af2a45448efa845e3e8f66c0a84ce
2021-11-16Add ParcelableUtils.Yu Shan
Add some helper functions to manage parsing/marshaling large parcelable. Test: None. Bug: 200737967 Change-Id: I48729915aafe6d23de725e38ca5f653ba3147253
2021-11-03Implement getPropConfigs in Default VHAL.Yu Shan
Test: atest DefaultVehicleHalTest Bug: 200737967 Change-Id: Id0152cb2dbf489f5d709845108b87961f6d9a019
2021-11-01Use FakeUserHal in FakeVehicleHardware.Yu Shan
Handle fake user hal properties in FakeVehicleHardware. Test: atest FakeVehicleHardwareTest Bug: 201830716 Change-Id: Ia60bbf7ae6a0fc5909dc8d27363af5c9939055d3
2021-10-29Migrate FakeObd2Frame to AIDL.Yu Shan
Test: atest FakeObd2FrameTest Bug: 201830716 Change-Id: I1d83db2b0a1eb08ddc86c2a6106403edb73b6536
2021-10-29Migrate Obd2SensorStore.Yu Shan
Test: atest FakeObd2FrameTest Bug: 201830716 Change-Id: Ibd460ab4c129707d567689d90979ca0424551a64
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.Yu Shan
Test: atest FakeVehicleHalValueGeneratorsTest Bug: 201830716 Change-Id: Ic113c9b189a07140a288d6d03d3a8a2b9061881f
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-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 fake vehicle hardware implementation.Yu Shan
Add a fake vehicle hardware implementation that uses default config. This would be used in emulator. Test: atest FakeVehicleHardwareTest Bug: 201830716 Change-Id: If93bdebb5c82b947a327688db80978fc4cb46d3c
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-24Add VHAL AIDL v1 service.Yu Shan
Test: Local build. Bug: 198664004 Change-Id: Ifd8b15d85865f360f9cce7b35bc2114f4478682c
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