Convert Vehicle Property to integer
This make sense for easier extending Vehicle Hal interface
by OEMs and creating new versions.
Test: adb shell "su system /data/nativetest/android.hardware.vehicle@2.0-manager-unit-tests/android.hardware.vehicle@2.0-manager-unit-tests" ; ENABLE_TREBLE=true make vts BUILD_GOOGLE_VTS=true -j32 && vts-tradefed run commandAndExit vts --skip-all-system-status-check --primary-abi-only --skip-preconditions --module VehicleHidlTest -l INFO
Change-Id: I02415a1c180a6d24fded48a1583f7cb150419820
Fix: b/34894217
diff --git a/vehicle/2.0/default/VehicleHal.h b/vehicle/2.0/default/VehicleHal.h
index 2807f28..c882def 100644
--- a/vehicle/2.0/default/VehicleHal.h
+++ b/vehicle/2.0/default/VehicleHal.h
@@ -36,7 +36,7 @@
using HalEventFunction = std::function<void(VehiclePropValuePtr)>;
using HalErrorFunction = std::function<void(
- StatusCode errorCode, VehicleProperty property, int32_t areaId)>;
+ StatusCode errorCode, int32_t property, int32_t areaId)>;
virtual ~VehicleHal() {}
@@ -57,16 +57,16 @@
* rate, e.g. for properties with
* VehiclePropertyChangeMode::CONTINUOUS
*/
- virtual StatusCode subscribe(VehicleProperty property,
- int32_t areas,
- float sampleRate) = 0;
+ virtual StatusCode subscribe(int32_t property,
+ int32_t areas,
+ float sampleRate) = 0;
/**
* Unsubscribe from HAL events for given property
*
* @param property vehicle property to unsubscribe
*/
- virtual StatusCode unsubscribe(VehicleProperty property) = 0;
+ virtual StatusCode unsubscribe(int32_t property) = 0;
/**
* Override this method if you need to do one-time initialization.
@@ -95,7 +95,8 @@
/* Propagates error during set operation to the vehicle HAL clients. */
void doHalPropertySetError(StatusCode errorCode,
- VehicleProperty propId, int32_t areaId) {
+ int32_t propId,
+ int32_t areaId) {
mOnHalPropertySetError(errorCode, propId, areaId);
}