Commit graph

678 commits

Author SHA1 Message Date
Yu Shan
5bd6aefe99 Add error code to VeiclePropertyStore.
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-19 17:04:38 -07:00
Yu Shan
8e7f780484 Add fake vehicle hardware implementation.
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-19 17:04:37 -07:00
Yu Shan
74bf81da0f Create GetValueRequest to include prop value and ID.
This type is similar to GetValueRequest that wraps both the request
value and the request ID. A vector of GetValueRequst would be turned
into largeParcelable for getValues input.

Test: None
Bug: 200737967
Change-Id: Ie8f3c0711c182fff8b7f88ac1aa78bf6ed85da38
2021-10-19 16:12:25 -07:00
Yu Shan
f527463ec0 Add on-value-change callback to propstore.
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-19 16:12:23 -07:00
Yu Shan
3910aa4b58 Fix minor bugs about value type.
Both requestId and timestamp is defined as 'long' in aidl, which
is 'int64_t' in c++.

Test: Presubmit
Bug: 201830716
Change-Id: I8c6e50aa7a67177bb4e01ab279f62ce772d1e1a9
2021-10-18 14:11:28 -07:00
Yu Shan
3d8595e3f9 Use ObjectPool objects in property store.
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-10-13 11:26:59 -07:00
TreeHugger Robot
9dbc3cebc9 Merge "Remove ndk_platform backend. Use the ndk backend." 2021-10-13 05:01:56 +00:00
Jiyong Park
bc6c0e9bb6 Remove ndk_platform backend. Use the ndk backend.
The ndk_platform backend will soon be deprecated because the ndk backend
can serve the same purpose. This is to eliminate the confusion about
having two variants (ndk and ndk_platform) for the same ndk backend.

Bug: 161456198
Test: m
Change-Id: Ib2af857ab464bc03c3ef04a42790ae632854577a
2021-10-12 16:36:54 +09:00
TreeHugger Robot
3f3ab31434 Merge "Fix CLUSTER_SWITCH_UI init value." 2021-10-08 22:15:42 +00:00
Yu Shan
6e289c86d9 Fix CLUSTER_SWITCH_UI init value.
CLUSTER_SWITCH_UI is a INT32 property that should only have one
init value instead of 2. This is causing confusion in the code
that uses the default value.

Test: None
Bug: 202448791
Change-Id: Id55f448f1dd5ee33291e30d32e6fbf868ad8fe3a
2021-10-08 13:26:30 -07:00
Bob Badour
47589e09e0 [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/Android.bp
  automotive/vehicle/aidl/impl/proto/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I9c8d81e2f899026607ee182a1c7fa1853d38cdc0
2021-10-07 16:13:14 -07:00
Keun young Park
8791c7ee75 update automotive hals for car mainline
- add min_sdk_version and apex_available

Bug: 192665266
Test: build
Change-Id: I34be81d542e51832a4f73c0227ca544e963ab3c9
2021-10-06 09:23:30 -07:00
TreeHugger Robot
ed9b778434 Merge "Add constants for hibernation to VHAL" 2021-10-05 14:55:41 +00:00
Yu Shan
a2bbcd26bd Migrate proto_message_converter to AIDL vhal.
Migrate proto_message_converter to AIDL vhal. This would be used
in grpc vehicleClient/vehiclServer. This CL also creates the
required proto files.

Test: unit tests.
Bug: 199337732
Change-Id: Iac69a8c1578d4aba374ee0d9716da8b6b18ccace
2021-10-04 12:57:16 -07:00
Maxim Pleshivenkov
cc4713ccdb Add constants for hibernation to VHAL
Extended VHAL with constants for hibernation
(suspend to disk).

Bug: 188666978
Test: manual
Change-Id: I11469b5e4c18ff6fa8450276188eaaa4c6cfa61a
2021-09-30 18:25:29 +00:00
Yu Shan
f86dae8918 Define an abstract interface to access hardware.
For non-virtualized VHAL, VHAL would use a VehicleHareware
implementation in the same process. For virtualized VHAL, on
android side, a VehicleHardware implementation acts as the client
to take with a GRPC server in another VM. That server uses a
VehicleHardware implementation underneath.

Test: Local build.
Bug: 199453627
Change-Id: I34512fad44aa4f69832d147d2c4ef4221e53dc4f
2021-09-29 13:37:55 -07:00
TreeHugger Robot
9974d946e1 Merge "[LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces" 2021-09-28 00:12:15 +00:00
Yu Shan
eb766523f2 Change unit test suites to device tests.
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-27 15:18:31 -07:00
Bob Badour
2f244076ff [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  automotive/vehicle/aidl/impl/vhal/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ic1778822784ec32904d235fe6677ef4f2711c2c4
2021-09-27 14:31:49 -07:00
Yu Shan
23a84dd8d6 Add VHAL AIDL v1 service.
Test: Local build.
Bug: 198664004
Change-Id: Ifd8b15d85865f360f9cce7b35bc2114f4478682c
2021-09-24 18:18:31 -07:00
Yu Shan
379c33ca66 Migrate VHAL default config to AIDL.
Test: atest VehicleHalDefaultConfigTest
Bug: 199337732
Change-Id: I9d96c82598427a597245d73a15c22eccff672250
2021-09-23 13:28:29 -07:00
Yu Shan
e4923de337 Add HidlAidlCompatibilityTest.
Add test to verify all properties defined in HIDL VHAL are also
defined in AIDL.

Test: atest VehicleHalAidlHidlCompatibilityTest
Bug: b/170400618
Change-Id: I5c9e26f5eb149477c18a6b22ca8a39d8642249df
2021-09-22 14:25:03 -07:00
Yu Shan
81fbbea6b9 Migrate VehiclePropertyStore.
Test: atest VehicleHalVehicleUtilsTest
Bug: 199337732
Change-Id: Ia18699a0115fdb004c57c0e6fb02b043ddb138b5
2021-09-21 16:30:17 -07:00
Yu Shan
00c39ebf00 Add VehicleHal utilities.
Add some utility functions to AIDL VHAL.

Test: atest VehicleHalVehicleUtilsTest
Bug: 199337732
Change-Id: I9e74161efecf7c66caa2f52177fbdd43cdc9d68b
2021-09-21 13:37:27 -07:00
Yu Shan
9de3fb07ce Migrate VehicleObjectPool
Test: atest VehicleHalVehicleUtilsTest
Bug: 199337732
Change-Id: I93772c401dc077f1fbab79e302336494039308d1
2021-09-13 17:28:00 -07:00
Yu Shan
59393a9ce7 Define IVehicle AIDL interface.
Define IVehicle AIDL interface according to new interface design
doc.

Test: Local build
Bug: 198664004
Change-Id: Ic757f969ccce6d9dcffc6e7cd19f55f86a41f435
2021-09-10 18:28:58 -07:00
Keun young Park
eadcf71d4b change all automotive AIDL HAL to generate Java for module
- CarService will become mainline module,

Bug: 192462140
Test: build
Change-Id: I71e2955de12594ff0a8dc74cdcc269997e214ef1
2021-06-30 12:14:40 -07:00
Keun young Park
7339375409 Add AIDL version of vehicle hal
- This is still under development but will replace HIDL version later.
- It will become stable later when all necessary features are ready.
- This CL translated HIDL into AIDL as it is. More changes will be added later.
- Most code was generate from hidl2aidl:
  $ hidl2aidl -o tmp android.hardware.automotive.vehicle@2.0
- translate_vehicle_props.py types.hal to generate VehicleProperty enum.
- added @utf8InCpp for all String

Bug: 148703287
Test: build, make -j android.hardware.automotive.vehicle-cpp android.hardware.automotive.vehicle-java
Change-Id: I7a7f1c0c0751ad0101958d56db939324c05400b5
2021-06-08 16:41:07 +00:00