Commit graph

1497 commits

Author SHA1 Message Date
shrikar
a45d1cfdc9 Added ELECTRONIC_STABILITY_CONTROL_STATE to HAL
Bug: 313455695
Test: atest VtsHalAutomotiveVehicle_TargetTest
FakeVehicleHardwareTest

Change-Id: I8d8d7d749f530a7c738c8a9dfd712496d118715a
2023-12-12 21:19:45 +00:00
shrikar
33a3369d18 Added ELECTRONIC_STABILITY_CONTROL_ENABLED to HAL
Bug: 313435670
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I7d9bdc5bfccc3037a29d7d9b72c705797cc53064
2023-12-12 21:16:32 +00:00
shrikar
84866f7c35 Added VALET_MODE_ENABLED to HAL
Bug: 313324764
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I2365ac050978ade0d441ff96bf9160bd2b6651e4
2023-12-12 21:16:32 +00:00
shrikar
858c4e1791 Added LOW_SPEED_COLLISION_WARNING_STATE to HAL
Bug: 310955303
Test: atest VtsHalAutomotiveVehicle_TargetTest
FakeVehicleHardwareTest

Change-Id: I30980af5af1d6b954d6a4166be4df6ac92235388
2023-12-12 21:16:32 +00:00
shrikar
45df34b615 Added LOW_SPEED_COLLISION_WARNING_ENABLED to HAL
Bug: 310252857
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: Ie2072d9cc0c8af83caf2f6e5590d5d1bd6c4e4aa
2023-12-12 21:16:32 +00:00
shrikar
a492e7d598 Added EV_BATTERY_AVERAGE_TEMPERATURE to HAL
Bug: 309861157
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I3ddf1d71969b233516cf6e617a4f9328e256ea7f
2023-12-12 21:16:32 +00:00
shrikar
d816e0433c Added IMPACT_DETECTED to HAL
Bug: 309826888
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I79c72bed8dcd96632cf9c7b6ff71c04198625467
2023-12-12 21:16:31 +00:00
shrikar
7717aa80ac Added SEAT_BELT_PRETENSIONER_DEPLOYED to HAL
Bug: 309666683
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I79ca3e68c18fb961e83d1bd67f794256fe806f55
2023-12-12 21:16:31 +00:00
shrikar
420b31dddf Added SEAT_AIRBAGS_DEPLOYED to HAL
Bug: 309620475
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I90db503d61c70cb2ab2581d3327a09b3225ac62c
2023-12-12 21:16:31 +00:00
shrikar
d6f9f8e4ec Added VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL to HAL
Bug: 309014379
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: I8b764ad7eb3fc05874f58d31499e6923bdb557c2
2023-12-11 23:13:45 +00:00
Yu Shan
e35cbd5d9a Merge "Use batched property updates in IVehicleHardware." into main 2023-12-11 22:29:45 +00:00
Eva Chen
31b852d133 Merge "Add DRIVER_DISTRACTION_WARNING to HAL layer." into main 2023-12-09 09:28:17 +00:00
Eva Chen
e0a1360cc5 Merge "Add DRIVER_DISTRACTION_WARNING_ENABLED to HAL layer." into main 2023-12-09 09:26:46 +00:00
Eva Chen
823ae19422 Merge "Add DRIVER_DISTRACTION_STATE to HAL layer." into main 2023-12-09 06:58:43 +00:00
Eva Chen
c2854e4bd1 Merge "Add DRIVER_DISTRACTION_SYSTEM_ENABLED to HAL layer." into main 2023-12-09 04:12:58 +00:00
Eva Chen
b08db8e5b3 Merge "Add DRIVER_DROWSINESS_ATTENTION_WARNING to HAL layer." into main 2023-12-09 02:43:55 +00:00
Yu Shan
863a1b2e54 Use batched property updates in IVehicleHardware.
This CL demonstrates how IVehicleHardware layer can batch property
update events for all continuous properties subscribed
at the same interval. For example, previously, 4 areas for tire
pressure, despite subscribed with the same interval, will generate
4 property update events through 4 binder calls. Since they are
updated at the same time, all the 4 events can be sent through one
binder call.

Note that this is different from the batching done at DefaultVehicleHal
side where the property events are put into a queue for batching. If
IVehicleHardware layer can provides batching, then we can avoid the
extra latency introduced by batching in DefaultVehicleHal layer.

In order to achieve batching, this CL adds several functions to
VehiclePropertyStore that operates on a list of values. Note that
VehiclePropertyStore is still backward compatible with this CL,
meaning that old APIs are not affected. But in order to achieve
better performance, caller can migrate to the newer APIs.

Test: atest FakeVehicleHardwareTest VehicleHalVehicleUtilsTest
Bug: 314850840
Change-Id: I94a13d3ed2b90aede4d627f73ce2f2828bb3e740
2023-12-07 17:14:16 -08:00
Treehugger Robot
209b180d41 Merge "Return config using a copy not a pointer." into main 2023-12-07 23:57:44 +00:00
Yu Shan
b2d54bf984 Return config using a copy not a pointer.
Introduce VehiclePropertyStore.getPropConfig that returns a copy of
the config instead of a constant pointer. If the internal map is updated,
the pointer might become invalid, so it is safer to just return a copy.

We do not modify the existing API for backward compatibility.

Test: atest VehiclePropertyStoreTest
Bug: 308202443
Change-Id: I769866a09577cc69d25276349b7688cabcbc0c20
2023-12-07 15:09:40 -08:00
Eva Chen
295de24b78 Merge "Add DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED to HAL layer." into main 2023-12-07 04:10:35 +00:00
Eva Chen
14c6111afa Merge "Add DRIVER_DROWSINESS_ATTENTION_STATE to HAL layer." into main 2023-12-07 04:09:02 +00:00
Shrikar Amirisetty
f1c5aa2bc2 Merge "Added new VehicleAreConfig.aidl fields to ProtoMessageConverter" into main 2023-12-06 16:54:19 +00:00
Eva Chen
9a0925e15f Add DRIVER_DISTRACTION_WARNING to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Test: atest CtsCarTestCases:DriverDistractionWarningTest
Test: atest AndroidCarApiTest:DriverDistractionWarningTest
Change-Id: Ib5ef9c8bd4f0f2a73a92e8ee08e6835ad24f95da
2023-12-05 18:52:57 -08:00
Eva Chen
c62166e3ab Add DRIVER_DISTRACTION_WARNING_ENABLED to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Change-Id: I6315dd0e7eb63c9e4e2314ae00b027ba7543e192
2023-12-05 18:30:00 -08:00
Eva Chen
a342b723fd Add DRIVER_DISTRACTION_STATE to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Test: atest CtsCarTestCases:DriverDistractionStateTest
Test: atest AndroidCarApiTest:DriverDistractionStateTest
Change-Id: I413291427b3d6243214d42c9efef63e29ab3e8da
2023-12-05 18:29:49 -08:00
Eva Chen
51770b0d70 Add DRIVER_DISTRACTION_SYSTEM_ENABLED to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Change-Id: I554725c48aa570a1d79db49d6090163b989e2fbc
2023-12-05 17:18:31 -08:00
Eva Chen
05c548cb58 Add DRIVER_DROWSINESS_ATTENTION_WARNING to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Test: atest CtsCarTestCases:DriverDrowsinessAttentionWarningTest
Test: atest AndroidCarApiTest:DriverDrowsinessAttentionWarningTest
Change-Id: I6e838cba6c6ee78cfb73d83582bd5b3e66d2cb20
2023-12-05 17:18:19 -08:00
Eva Chen
0c285d7f98 Merge "Add DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED to HAL layer." into main 2023-12-05 19:55:50 +00:00
Shrikar Amirisetty
3d096c4456 Merge "Created new tool to partially generate java enum in framework from aidl" into main 2023-12-03 02:55:35 +00:00
Eva Chen
6ec790b400 Add DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Change-Id: I9e80fe45dd17ec3502fd52809fa5a88d145e5806
2023-12-02 00:14:07 -08:00
Eva Chen
9f1d8c028f Add DRIVER_DROWSINESS_ATTENTION_STATE to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Test: atest CtsCarTestCases:CarPropertyManagerTest
Test: atest CtsCarTestCases:VehiclePropertyIdsTest
Test: atest CtsCarTestCases:DriverDrowsinessAttentionStateTest
Test: atest AndroidCarApiTest:DriverDrowsinessAttentionStateTest
Change-Id: I6d1b058fd84c124b08607bdb4f7eb99198219863
2023-12-01 23:12:33 -08:00
shrikar
0ca801eb6a Created new tool to partially generate java enum in framework from aidl
Bug: 309010685
Test: Tested by generating enums for upcoming property CLs
Change-Id: Ieee43f888262723828548787653f0b1b84de3691
2023-12-02 00:03:25 +00:00
Eva Chen
bbb7b6da5d Add DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED to HAL layer.
Bug: 292142225
Test: atest VtsHalAutomotiveVehicle_TargetTest
Change-Id: Ic7e55d3dff58e4836e706ca627b56602e5421855
2023-11-30 23:06:45 -08:00
Yu Shan
e5456f1c57 Refactor RecurrentTimer to use Looper.
Use Looper to make the logic cleaner.

Test: atest VehicleHalVehicleUtilsTest
Bug: 305103906

Change-Id: I5a4669b104964ac1dddff4b70b19b2f4e94c2b90
2023-11-30 13:52:11 -08:00
Yu Shan
c69b857b8d Use timestamp from property store when get prop.
Previously the timestamp in property events might come from two
different sources. For property update events, the timestamp is
generated from VehicleHalServer. For getProperty request, the
timestamp is generated from EmulatedVehicleHal. This might cause
a getProperty request which returns an older value to have a newer
timestamp compared to the newer property update event. As a result,
the new property update event will be ignored by the client, which
should not be the case since the property is actually updated and
the client should get the update.

This causes flaky test cases if the client is try to subscribe, which
will cause a get property request for the initial value and the client
is changing the value, which will cause a new property update event at
the same time.

Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests
Bug: 311219830
Change-Id: I78613b1de30624011bd90a5d0da244f0e3d67337
2023-11-30 13:06:07 -08:00
Yu Shan
60a76f0e04 Fix testListProperties test.
We should update the config count in the unit test for
ag/25331307.

Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests
Bug: 310035422
Change-Id: I821e43ec7fda31007457821186cce7fd0bc4f9b6
2023-11-30 11:14:11 -08:00
Aaqib Ismail
7a8a8ad079 Change temp approximations to be accurate
We need to use a more accurate ratio of celsius to fahrenheit along
with better min/max temperature conversions so if a client sets the
value using standard conversion or using this table, they will produce
the same result.

Bug: 313720524
Test: atest CtsCarTestCases:CarPropertyManagerTest
Change-Id: I80a45962e7025c9c529381fd3522839f78bf413f
2023-11-29 10:57:03 -08:00
Yu Shan
d061fb1a16 Merge "Make refreshTimestamp atomic." into main 2023-11-28 23:03:46 +00:00
Treehugger Robot
69bc163129 Merge "Sandbox VehicleServerProtoStub_cc/h@default-grpc" into main am: 73c04536b0 am: fab0804671 am: 0559030fc7
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2838463

Change-Id: I9a7dc6aa5ca89e364ce9192344b521be37ae435e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-22 21:57:46 +00:00
Treehugger Robot
fab0804671 Merge "Sandbox VehicleServerProtoStub_cc/h@default-grpc" into main am: 73c04536b0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2838463

Change-Id: I761f48b9c8c337af4442267c28a2f69032d92995
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-22 20:35:14 +00:00
Yu Shan
f841761157 Make refreshTimestamp atomic.
Make refreshTimestamp atomic in VehiclePropertyStore so that we
are sure the property value will not be updated after we read
the value out, but before we put the value with the new timestamp back.

Otherwise there is a slight chance that a property update will be
overwritten by the timestamp refresh operation.

Test: atest FakeVehicleHardwareTest
Bug: 308552957
Change-Id: I789257b4c75d8a4d19edeec31d01dc23776233ec
2023-11-22 11:12:56 -08:00
Yu Shan
d448cb63d1 Backport LocCharacterization.
Backport Location Characterization property to ref HIDL VHAL. Define
a new backported property helper library for the backported constants.

Test: Build and verify the backported property can be accessed.
Bug: 310035422
Change-Id: I2b53f82707a45cd3a761d295e3fd2444ff5c82c8
2023-11-21 13:17:25 -08:00
Yu Shan
dbb69167b6 Fix a race condition in RecurrentTimer.
Previously RecurrentTimer might not exit correctly if the mStopRequested
is set to true after we check for the value in the loop, but before
we start the wait. We will notify before we start waiting, causing the
wait never to return until timeout.

This CL guards updating mStopRequested with lock to make sure that it
must not change between our check and the wait.

After the fix we see no more flaky tests and decreased test execution
time since we will not wait for the next event to come before we end
the timer.

Test: atest android.hardware.automotive.vehicle@2.0-default-impl-unit-tests
Bug: 311757267
Change-Id: Iab1d72b954b4b02aa68e6fbbabcb97b572614d35
2023-11-21 01:57:56 +00:00
Cole Faust
52d7446074 Sandbox VehicleServerProtoStub_cc/h@default-grpc
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py VehicleServerProtoStub_cc@default-grpc VehicleServerProtoStub_h@default-grpc
Change-Id: I35d56c909e5eda8bc337f7f994e669fb8e3c9cb0
2023-11-20 14:36:58 -08:00
Treehugger Robot
f7051951e0 Merge "Refactored vehicleManager_fuzzer" into main am: 3db45f8509 am: 1daa555faf am: a4b5a6aa59
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2769161

Change-Id: I89c8ba7d97969a8782a0277987d74eb0efb9b6a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 10:48:04 +00:00
Treehugger Robot
1daa555faf Merge "Refactored vehicleManager_fuzzer" into main am: 3db45f8509
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2769161

Change-Id: If5cc1fe6e378291a37a63131597c3353b857be04
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-17 09:45:01 +00:00
Treehugger Robot
3db45f8509 Merge "Refactored vehicleManager_fuzzer" into main 2023-11-17 09:15:07 +00:00
Yu Shan
ad88911882 Merge "Guard update timestamp logic with lock." into main 2023-11-15 02:08:01 +00:00
Shrikar Amirisetty
b0b0f4258f Merge "Updated DefaultVehicleHal to check VehicleAreaConfig.access" into main 2023-11-14 17:07:10 +00:00
Yu Shan
ea66a1b327 Guard update timestamp logic with lock.
Guard the logic to update property value timestamp with lock so that
they will not overlap. Otherwise, it is possible that another op will
update the timestamp to a newer value, which causes this op to fail
the timestamp freshness check.

Test: atest --iterations 10 FakeVehicleHardwareTest#testSubscribe_enableVUR
Bug: 308552957
Change-Id: I8f7a6356ba65e4470e851e59c20bb1f678c2d467
2023-11-13 14:22:39 -08:00