Commit graph

877 commits

Author SHA1 Message Date
Victor Shutemov
1d4fe975c5 Add emulator metadata generator script
Add script to generate vehicle properties metadata file
for use with emulator's vehicle tab.
Metadata includes:
    - names of the properties,
    - names for the data enum values
    - change and access modes

Change-Id: Ica1df3466b7965916d11adc513f6472d439e1119
2023-03-15 11:27:14 +00:00
Maxim Pleshivenkov
124c3cde03 Update flag value
Set ENABLE_HIBERNATION_FLAG to a correct value.
Flag is used as a bitmask, and should set single bit.

Bug: 233373476
Change-Id: Ia60cdb3c9c344b3606ea07ed411ed6325a71c396
Test: atest CarServiceUnitTest
2022-05-20 18:59:30 +00:00
Yu Shan
b47e11e847 Fix a bug that would access uninitialized data.
Fix a bug where mThread is initialized before mRequests, causing
the new thread to access uninitialized mRequests.

Test: None. This is a race condition depending on when the thread is
started and hard to reproduce.
Bug: 231647009

Change-Id: I68037125bf4d14846585bd3a038844e4a7ced377
(cherry picked from commit 5e26ad3bf7)
2022-05-07 00:46:32 +00:00
TreeHugger Robot
1eb9ba70b8 Merge "Added supportedAreas for CRITICALLY_LOW_TIRE_PRESSURE" into tm-dev 2022-04-29 00:24:12 +00:00
Tyler Trephan
4677012912 Added supportedAreas for CRITICALLY_LOW_TIRE_PRESSURE
Test: atest CarPropertyManagerTest
Fix: 230386029
Change-Id: Idbd07a361f11b6b616c11ef2c359b656012b40cc
2022-04-25 22:58:59 +00:00
TreeHugger Robot
94b57a5d01 Merge "Added min/max rates for EV_CHARGE_TIME_REMAINING" into tm-dev 2022-04-22 16:26:28 +00:00
Tyler Trephan
e438bd358b Added min/max rates for EV_CHARGE_TIME_REMAINING
Test: atest CarPropertyManagerTest
Bug: 229118601
Change-Id: I6adedf1def47486ebe3cf9d12abe2bd65e0d6d48
2022-04-21 20:30:17 +00:00
Jiyong Park
70f5837e1f Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: I61eb51c0334eb99489c6f1570110d7e18c350c99
2022-04-16 07:03:24 +09:00
Tyler Trephan
fdf818ffce Updated EV_CHARGE_CURRENT_DRAW_LIMIT config array
Test: atest CarPropertyManagerTest
Bug: 229118601
Change-Id: If894454260852a1c7fa7ebfb3cf98682120bb397
2022-04-13 19:49:17 +00:00
Yu Shan
e3421c3ce2 Support '--user-hal' in FakeVehicleHardware.
Support dump fake user hal command in FakeVehicleHardware.

Test: atest FakeVehicleHardwareTest
Bug: 228218366
Change-Id: I9884a1a216d07da6ccb58af1fa869266c959f80c
2022-04-09 00:31:17 +00:00
Yu Shan
6923449c42 Make FakeVehicleHardware async.
Use a handler thread to handle all the get/set value requests in
FakeVehicleHardware to make it async. Vendor implementation should
use similar logic to make their VHAL async.

Test: atest FakeVehicleHardwareTest
Bug: 226001897
Change-Id: Iba95125e63566c27597b9d11bff131c229846d49
2022-04-09 00:31:17 +00:00
Yu Shan
4569ef5542 Add VTS test for timestamp for AIDL backend.
The expected behavior for timestamp was not clearly defined in HIDL.
In AIDL, we add clearer definition based on the existing HIDL ref
impl's behavior. This CL add VTS test to enforce these behavior for
AIDL backend.

Test: atest VtsHalAutomotiveVehicle_TargetTest
Bug: 225191802
Change-Id: Ic208d6ac20cb7b820249c9b545c7b3a83528a1dd
2022-04-09 00:31:17 +00:00
TreeHugger Robot
9c15ed74b6 Merge "Update subscription logic for VHAL ref impl." into tm-dev 2022-04-08 23:07:06 +00:00
Yu Shan
5a06465d3c Update subscription logic for VHAL ref impl.
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-04-06 23:40:17 +00:00
Jiyong Park
703e97920e Freeze AIDL APIs for TM
Bug: 225941299
Test: m
Change-Id: Ie41cc0797710f813f92c65c387f247c7806d8394
2022-03-31 12:01:39 +09:00
Nishtha Ahuja
f898641c09 Merge "Add default config for new VHAL properties in Android T." into tm-dev 2022-03-31 01:27:27 +00:00
Yu Shan
237cd1c054 Merge "Add ECHO_REVERSE_BYTES in VHAL ref impl." into tm-dev 2022-03-30 21:11:42 +00:00
Nishtha Ahuja
10651a6e68 Add default config for new VHAL properties in Android T.
Bug: 218388191
Test: manually tested in KitchenSink app
Change-Id: I08b980a272e66d87de134dc37d6916209f4b4374
2022-03-30 04:38:34 +00:00
Yu Shan
abd3431f9e Add ECHO_REVERSE_BYTES in VHAL ref impl.
This is a test property to test LargeParcelable end to end. It would
echo byte values back in reversed order.

Test: atest AndroidCarApiTest:android.car.apitest.VehicleHalLargeParcelableTest
Bug: 224595312
Change-Id: Ib07c7f602613919aef452ac8796a93988a1a9d65
2022-03-25 01:33:01 +00:00
Bob Badour
852a53027a [LSC] Add LOCAL_LICENSE_KINDS to hardware/interfaces
Added SPDX-license-identifier-Apache-2.0 to:
  automotive/vehicle/vts/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ic7216f0da29aabfad2ce3614e5f9ee40055aa609
2022-03-24 23:44:04 +00:00
Yu Shan
10707d6ae9 Merge changes from topics "aidl_vhal_vts", "vhalresult" into tm-dev
* changes:
  Define VhalResult alias.
  Migrate VHAL VTS to be AIDL compatible.
2022-03-17 19:00:01 +00:00
Yu Shan
2897aff9d8 Handle sample rate out of bound correctly.
This CL changes the behavior when sample rate is out of bound
for VHAL. Sample rate would be fitted to the range if out-of-bound.
Also added some comments to clearly document this behavior.

Test: atest DefaultVehicleHalTest
atest CtsCarTestCases
Bug: 225025926

Change-Id: Id853070cb0dc823855a68f86a01de2ff2a011577
2022-03-17 00:40:55 +00:00
Yu Shan
24fee7bba9 Define VhalResult alias.
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-04 14:07:45 -08:00
Yu Shan
726d51a697 Migrate VHAL VTS to be AIDL compatible.
Migrate VHAL VTS to be compatible with both HIDL and AIDL VHAL. The
test cases remains the same.

Test: atest VtsHalAutomotiveVehicle_TargetTest
Bug: 216736141
Change-Id: I5010b9c205656187e890b91dadc69e97ddc96862
2022-03-04 14:07:45 -08:00
Yu Shan
f46e1df10b Clean up resource correctly when client died.
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-04 14:07:43 -08:00
Yu Shan
a58110ea59 Define custom error type for StatusCode.
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-03-03 02:31:37 +00:00
TreeHugger Robot
273583165c Merge changes from topic "fakevaluegeneratortest" into tm-dev
* changes:
  Fix a flaky test in FakeVehicleHalValueGeneratorsTest.
  Improve test coverage for FakeValueGenerator.
2022-02-25 04:19:11 +00:00
Yu Shan
d0e9111cad Fix a flaky test in FakeVehicleHalValueGeneratorsTest.
Fix a flaky test which might be caused by when the lock is waked
up, we might have more events than what we want. Furthermore, we
have to clear existing events after unregistering event generator.

Test: atest FakeVehicleHalValueGeneratorTest 10 times on cf_auto
Bug: 221084327
Change-Id: I65e87fa62b8538164fcdd60a9df871a9817f4f8e
Merged-In: I65e87fa62b8538164fcdd60a9df871a9817f4f8e
(cherry picked from commit 6ae468c1e3)
2022-02-25 00:33:01 +00:00
Yu Shan
83fe805275 Improve test coverage for FakeValueGenerator.
Bug: None
Test: atest FakeVehicleHalValueGeneratorsTest
Change-Id: I6df508e148ff0348fc28b467b4e5a70cf5727a27
Merged-In: I6df508e148ff0348fc28b467b4e5a70cf5727a27
(cherry picked from commit 6ae468c1e3)
2022-02-25 00:32:13 +00:00
Yu Shan
b48b6e28cb Improve getPropConfigs and error logging.
This CL improves getPropConfigs to return INVALID_ARG when one of
the prop ID is not found according to the AIDL interface definition.

This CL also improves logging to print out exception code.

This CL also updates service manifest to be consistent with
https://source.android.com/devices/architecture/aidl/aidl-hals

Test: atest DefaultVehicleHalTest
Bug: 219782023, 219612366
Change-Id: I96b091c5cf6641ab7d1df5c644bde7491cbaa5e7
2022-02-24 15:05:08 -08:00
TreeHugger Robot
9f30b47e16 Merge "Always trigger prop change event for WAIT_FOR_VHAL." into tm-dev 2022-02-24 21:40:44 +00:00
TreeHugger Robot
c4c403b894 Merge "Add tests that might be affected by HAL to presubmit." into tm-dev 2022-02-24 17:07:12 +00:00
Chih-hung Hsieh
34593d4e2a Merge "Add timed out test files to tidy_timeout_srcs" am: ff54f73b4f am: fa83970b3a am: 581616e658
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1992232

Change-Id: I2eac13fe3b5ab0b4f15d6ceadf376e5e74124a81
2022-02-24 01:32:09 +00:00
Chih-hung Hsieh
fa83970b3a Merge "Add timed out test files to tidy_timeout_srcs" am: ff54f73b4f
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1992232

Change-Id: Ic6072a539d185abc0bcce2ef1dd4a96ddf70e3b8
2022-02-24 00:40:48 +00:00
Yu Shan
69ab393b88 Always trigger prop change event for WAIT_FOR_VHAL.
CarService always expect VHAL to generate a property change event
when sending WAIT_FOR_VHAL even though there is not actual power
state change in VHAL.

VHAL power state might already be ON when receive WAIT_FOR_VHAL if
CarService client crashes and restarts. In this case, CarService
still expects an event to be generated.

VehiclePropStore would only generate event when there is an actual
property value change, so we must erase the value before setting
the value to ensure a change event.

Test: atest FakeVehicleHardwareTest
Bug: 219861737
Change-Id: I185b07e188f0b581253b5ab29faf859247ed9d38
2022-02-23 12:40:23 -08:00
Yu Shan
e77f6be875 Add tests that might be affected by HAL to presubmit.
Add list of tests to auto-presubmit for HAL changes. CarServiceTest
and CarServiceUnitTest theoratically should not interact with real
HAL, but add them as well just in case they are affected.

Test: Presubmit
Bug: 219843089
Change-Id: I47350d1d0683fd4fa505e289540fd5ce9034ebb9
2022-02-23 12:40:04 -08:00
Chih-Hung Hsieh
ad1bf31b78 Add timed out test files to tidy_timeout_srcs
* Timed out runs do not show any warning messages.
* These test files cannot finish clang-tidy runs with
  the following settings:
    TIDY_TIMEOUT=90
    WITH_TIDY=1
    CLANG_ANALYZER_CHECKS=1
* When TIDY_TIMEOUT is set, in Android continuous builds,
  tidy_timeout_srcs files will not be compiled by clang-tidy.
  When developers build locally without TIDY_TIMEOUT,
  tidy_timeout_srcs files will be compiled.
* Some of these test modules may be split into smaller ones,
  or disable some time consuming checks, and then
  enable clang-tidy to run within limited time.

Bug: 201099167
Test: make droid tidy-hardware-interfaces_subset
Change-Id: I1de28f1572fff368f67eab512fffec9f2e5c2a9b
2022-02-18 17:25:41 -08:00
Antonio Kantek
40882e1f54 Merge "Update CustomInputType AIDL documentation" 2022-02-17 17:06:58 +00:00
Antonio Kantek
b62be4dbac Update CustomInputType AIDL documentation
OEMs are now free to pick any input code to represent their custom input
event.

Bug: 217288618
Test: atest CarServiceUnitTest
Change-Id: I48c967f0b2692bedef32cfae5435c8d4624e353f
2022-02-16 10:30:09 -08:00
Yu Shan
9ab4ffb43e Add AndroidCarApiTest to presubmit.
Add AndroidCarApiTest to presubmit because it is using VHAL.

Test: None
Bug: None
Change-Id: I4be1e2bb10a8a1f59cbc36b029083a7781fde5fa
2022-02-15 19:29:19 -08:00
Yu Shan
6753453867 Remove default value for AP_POWER_STATE_REQ.
Remove the default value for AP_POWER_STATE_REQ because initially the
device should be in an OFF state, but there is no such
AP_POWER_STATE_REQ. If we set the default value to ON, then when
VHAL set the value to ON, it would cause no value update event to
inform CarService.

Test: atest FakeVehicleHardwareTest.
Manually run audio test on cf target.
Bug: 218924258

Change-Id: I3552a38bf2433015767c2254e42871cee5c9e716
2022-02-12 00:53:25 +00:00
Xin Li
0bf8f21279 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: Id9e06f88539b59480d5cf57a4ba67cef4676c1d5
Change-Id: Id6b1ea4f8700446b044255e80f21c137aeb7acf1
2022-02-11 07:27:13 +00:00
Yu Shan
75d311d54e Make VehicleHalUtils vendor available.
Test: Presubmit
Bug: 214635003
Change-Id: I402725599ec22574ed2bd5620e9b9328ff1800f4
2022-02-09 12:03:11 -08:00
TreeHugger Robot
afbb9baf07 Merge "Add vehicle curb weight property" 2022-02-08 20:18:25 +00:00
Kiran Rachuri
20014dab39 Add vehicle curb weight property
Bug: 197026083
Test: Build
Change-Id: I8c621b355e3d199dbac7a6170c1281fa2d7e03ad
2022-02-08 16:42:46 +00:00
Yu Shan
911588a887 Merge "Remove full namespace in header file." 2022-02-07 22:47:32 +00:00
Yu Shan
d0c0bbb6ce Remove full namespace in header file.
Test: Presubmit.
Bug: 215443397
Change-Id: If8d3556e06119d12f515dc68a591e0f342761d6f
2022-02-03 17:58:48 -08:00
Kiran Rachuri
6c4bb0aae6 Add trailer present property
Bug: 197026083
Test: Build
Change-Id: I734f35e3d7ef17aa47c2c2cc57ba87e6e7944e79
2022-02-04 00:12:39 +00:00
Kiran Rachuri
8f1f1503c5 Add properties for EV charging
Bug: 209021366
Test: Build
Change-Id: Iec82501e478830ff7f1830750394ad5b0ecc9735
2022-02-03 15:48:50 +00:00
Yu Shan
b819484c47 Rename VehicleHalUtils to VehicleHalUtilsVendor.
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-31 18:34:19 -08:00