Support dump fake user hal command in FakeVehicleHardware.
Test: atest FakeVehicleHardwareTest
Bug: 228218366
Change-Id: I9884a1a216d07da6ccb58af1fa869266c959f80c
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
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
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
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
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
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
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
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)
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
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
OEMs are now free to pick any input code to represent their custom input
event.
Bug: 217288618
Test: atest CarServiceUnitTest
Change-Id: I48c967f0b2692bedef32cfae5435c8d4624e353f
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
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
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
Add some helper function for EmulatedVehicleHardware to use.
Test: atest FakeVehicleHardwareTest
Bug: 215419573
Change-Id: I64da5a0eae3872c608da925d68756a823299672c
VehicleHalProto would be used by AIDL Vhal as well so move it to
a common place.
Test: Presubmit
Bug: 215419573
Change-Id: I1e886a64a6c5ef76f7dc918feccc9cf63b8bca0c
Support debug interface to set property value in FakeVehicleHardware.
Test: atest FakeVehicleHardwareTest.
Bug: 214613918
Change-Id: I64ef532274e20db1444e8583d71e0c0955c5b460
Add a macro guard for log messages to prevent spam.
Test: Manually test on emulator.
Bug: 200737967
Change-Id: I27a270fe70cf706307a0908d6d4aae8e5197a3e5
Implement linkToDeath for binders. Delete allocated resources for a
binder when it died or unlinked.
This CL also uses 'const AIBinder*' as client id type instead of
the callback because the Binder object corresponds to the remote
proxy and is guaranteed to be unique per client.
Bug: 204943359
Test: atest DefaultVehicleHalTest
Change-Id: If2e0c58e86a041a78b8ca69597aef4733ce1826c
This CL renames GetSetValuesClient to ConnectedClient and add
SubscribeClient to the supported client type. The SubscribeClient
would provide a different timeout and on-results callback.
This CL adds a map for subscribe clients in VHAL and initializes
subscription manager.
Test: None, will add after we implement subscribe.
Bug: 200737967
Change-Id: I222b155e4365dcf0fa9344c7da5901142433f055
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
Use PendingRequestPool in default VHAL to manage pending requests.
It would check for duplicate request IDs, call callbacks when request
timeout.
Test: atest DefaultVehicleHalTest
Bug: 203713317
Change-Id: Ifa42e6f06036c48914c56e357714b6dfb7173538