Loading vehicle/2.0/default/Android.mk +8 −6 Original line number Diff line number Diff line Loading @@ -25,13 +25,15 @@ LOCAL_SRC_FILES := \ vehicle_hal_manager/AccessControlConfigParser.cpp \ vehicle_hal_manager/SubscriptionManager.cpp \ vehicle_hal_manager/VehicleHalManager.cpp \ vehicle_hal_manager/VehicleObjectPool.cpp \ vehicle_hal_manager/VehicleUtils.cpp \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ $(module_prefix) \ Loading @@ -47,11 +49,11 @@ LOCAL_SRC_FILES:= \ impl/DefaultVehicleHal.cpp \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ $(module_prefix) \ Loading @@ -69,17 +71,17 @@ LOCAL_WHOLE_STATIC_LIBRARIES := $(module_prefix)-manager-lib LOCAL_SRC_FILES:= \ tests/AccessControlConfigParser_test.cpp \ tests/VehicleObjectPool_test.cpp \ tests/VehiclePropConfigIndex_test.cpp \ tests/SubscriptionManager_test.cpp \ tests/VehicleHalManager_test.cpp \ tests/VehicleObjectPool_test.cpp \ tests/VehiclePropConfigIndex_test.cpp \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ $(module_prefix) \ Loading @@ -105,11 +107,11 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \ $(module_prefix)-default-impl-lib \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ android.hardware.vehicle@2.0 Loading vehicle/2.0/default/impl/DefaultConfig.h +22 −20 Original line number Diff line number Diff line Loading @@ -83,12 +83,13 @@ const VehiclePropConfig kVehicleProperties[] = { .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1), .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1), .minInt32Value = 1, .maxInt32Value = 7 }}) } } }, { Loading @@ -107,7 +108,7 @@ const VehiclePropConfig kVehicleProperties[] = { .supportedAreas = VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), .minFloatValue = 16, Loading @@ -117,7 +118,8 @@ const VehiclePropConfig kVehicleProperties[] = { .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), .minFloatValue = 16, .maxFloatValue = 32, }}) } } }, { Loading Loading @@ -146,12 +148,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minFloatValue = 0, .maxFloatValue = 1.0 } }) } }, { Loading @@ -159,12 +161,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minInt32Value = 0, .maxInt32Value = 10 } }) } } }; Loading vehicle/2.0/default/tests/SubscriptionManager_test.cpp +29 −33 Original line number Diff line number Diff line Loading @@ -43,25 +43,22 @@ public: sp<IVehicleCallback> cb2 = new MockedVehicleCallback(); sp<IVehicleCallback> cb3 = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> subscrToProp1 = init_hidl_vec( { hidl_vec<SubscribeOptions> subscrToProp1 = { SubscribeOptions { .propId = PROP1, .vehicleAreas = toInt(VehicleAreaZone::ROW_1_LEFT), .flags = SubscribeFlags::HAL_EVENT }, }); }; hidl_vec<SubscribeOptions> subscrToProp2 = init_hidl_vec( { hidl_vec<SubscribeOptions> subscrToProp2 = { SubscribeOptions { .propId = PROP2, .flags = SubscribeFlags::HAL_EVENT }, }); }; hidl_vec<SubscribeOptions> subscrToProp1and2 = init_hidl_vec( { hidl_vec<SubscribeOptions> subscrToProp1and2 = { SubscribeOptions { .propId = PROP1, .vehicleAreas = toInt(VehicleAreaZone::ROW_1_LEFT), Loading @@ -71,7 +68,7 @@ public: .propId = PROP2, .flags = SubscribeFlags::HAL_EVENT }, }); }; static std::list<sp<IVehicleCallback>> extractCallbacks( const std::list<sp<HalClient>>& clients) { Loading Loading @@ -144,14 +141,13 @@ TEST_F(SubscriptionManagerTest, mulipleSubscriptions) { // Same property, but different zone, to make sure we didn't unsubscribe // from previous zone. manager.addOrUpdateSubscription(cb1, init_hidl_vec( { manager.addOrUpdateSubscription(cb1, { SubscribeOptions { .propId = PROP1, .vehicleAreas = toInt(VehicleAreaZone::ROW_2), .flags = SubscribeFlags::DEFAULT } })); }); clients = manager.getSubscribedClients(PROP1, toInt(VehicleAreaZone::ROW_1_LEFT), Loading vehicle/2.0/default/tests/VehicleHalManager_test.cpp +21 −24 Original line number Diff line number Diff line Loading @@ -182,8 +182,8 @@ public: }; TEST_F(VehicleHalManagerTest, getPropConfigs) { hidl_vec<VehicleProperty> properties = init_hidl_vec( { VehicleProperty::HVAC_FAN_SPEED,VehicleProperty::INFO_MAKE} ); hidl_vec<VehicleProperty> properties = { VehicleProperty::HVAC_FAN_SPEED, VehicleProperty::INFO_MAKE }; bool called = false; manager->getPropConfigs(properties, Loading @@ -197,7 +197,7 @@ TEST_F(VehicleHalManagerTest, getPropConfigs) { ASSERT_TRUE(called); // Verify callback received. called = false; manager->getPropConfigs(init_hidl_vec({VehicleProperty::HVAC_FAN_SPEED}), manager->getPropConfigs({ VehicleProperty::HVAC_FAN_SPEED }, [&called] (StatusCode status, const hidl_vec<VehiclePropConfig>& c) { ASSERT_EQ(StatusCode::OK, status); Loading Loading @@ -230,13 +230,12 @@ TEST_F(VehicleHalManagerTest, halErrorEvent) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = init_hidl_vec( { hidl_vec<SubscribeOptions> options = { SubscribeOptions { .propId = PROP, .flags = SubscribeFlags::DEFAULT }, }); }; StatusCode res = manager->subscribe(cb, options); ASSERT_EQ(StatusCode::OK, res); Loading @@ -249,13 +248,12 @@ TEST_F(VehicleHalManagerTest, subscribe) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = init_hidl_vec( { hidl_vec<SubscribeOptions> options = { SubscribeOptions { .propId = PROP, .flags = SubscribeFlags::DEFAULT }, }); } }; StatusCode res = manager->subscribe(cb, options); ASSERT_EQ(StatusCode::OK, res); Loading Loading @@ -291,13 +289,12 @@ TEST_F(VehicleHalManagerTest, subscribe_WriteOnly) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = init_hidl_vec( { hidl_vec<SubscribeOptions> options = { SubscribeOptions { .propId = PROP, .flags = SubscribeFlags::HAL_EVENT }, }); }; StatusCode res = manager->subscribe(cb, options); // Unable to subscribe on Hal Events for write-only properties. Loading vehicle/2.0/default/tests/VehicleHalTestUtils.h +34 −34 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ const VehiclePropConfig kVehicleProperties[] = { .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = static_cast<int32_t>( VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), .minInt32Value = 1, Loading @@ -53,7 +53,7 @@ const VehiclePropConfig kVehicleProperties[] = { .minInt32Value = 1, .maxInt32Value = 5, } }), } }, // Write-only property Loading @@ -64,7 +64,7 @@ const VehiclePropConfig kVehicleProperties[] = { .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = static_cast<int32_t>( VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), .minInt32Value = 64, Loading @@ -74,7 +74,7 @@ const VehiclePropConfig kVehicleProperties[] = { .minInt32Value = 64, .maxInt32Value = 80, } }), } }, { Loading @@ -82,12 +82,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minFloatValue = 0, .maxFloatValue = 1.0 } }) } }, { Loading @@ -95,12 +95,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minInt32Value = 0, .maxInt32Value = 10 } }) } }, { Loading Loading
vehicle/2.0/default/Android.mk +8 −6 Original line number Diff line number Diff line Loading @@ -25,13 +25,15 @@ LOCAL_SRC_FILES := \ vehicle_hal_manager/AccessControlConfigParser.cpp \ vehicle_hal_manager/SubscriptionManager.cpp \ vehicle_hal_manager/VehicleHalManager.cpp \ vehicle_hal_manager/VehicleObjectPool.cpp \ vehicle_hal_manager/VehicleUtils.cpp \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ $(module_prefix) \ Loading @@ -47,11 +49,11 @@ LOCAL_SRC_FILES:= \ impl/DefaultVehicleHal.cpp \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ $(module_prefix) \ Loading @@ -69,17 +71,17 @@ LOCAL_WHOLE_STATIC_LIBRARIES := $(module_prefix)-manager-lib LOCAL_SRC_FILES:= \ tests/AccessControlConfigParser_test.cpp \ tests/VehicleObjectPool_test.cpp \ tests/VehiclePropConfigIndex_test.cpp \ tests/SubscriptionManager_test.cpp \ tests/VehicleHalManager_test.cpp \ tests/VehicleObjectPool_test.cpp \ tests/VehiclePropConfigIndex_test.cpp \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ $(module_prefix) \ Loading @@ -105,11 +107,11 @@ LOCAL_WHOLE_STATIC_LIBRARIES := \ $(module_prefix)-default-impl-lib \ LOCAL_SHARED_LIBRARIES := \ liblog \ libbinder \ libhidlbase \ libhidltransport \ libhwbinder \ liblog \ libutils \ android.hardware.vehicle@2.0 Loading
vehicle/2.0/default/impl/DefaultConfig.h +22 −20 Original line number Diff line number Diff line Loading @@ -83,12 +83,13 @@ const VehiclePropConfig kVehicleProperties[] = { .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = toInt(VehicleAreaZone::ROW_1), .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1), .minInt32Value = 1, .maxInt32Value = 7 }}) } } }, { Loading @@ -107,7 +108,7 @@ const VehiclePropConfig kVehicleProperties[] = { .supportedAreas = VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), .minFloatValue = 16, Loading @@ -117,7 +118,8 @@ const VehiclePropConfig kVehicleProperties[] = { .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), .minFloatValue = 16, .maxFloatValue = 32, }}) } } }, { Loading Loading @@ -146,12 +148,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minFloatValue = 0, .maxFloatValue = 1.0 } }) } }, { Loading @@ -159,12 +161,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minInt32Value = 0, .maxInt32Value = 10 } }) } } }; Loading
vehicle/2.0/default/tests/SubscriptionManager_test.cpp +29 −33 Original line number Diff line number Diff line Loading @@ -43,25 +43,22 @@ public: sp<IVehicleCallback> cb2 = new MockedVehicleCallback(); sp<IVehicleCallback> cb3 = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> subscrToProp1 = init_hidl_vec( { hidl_vec<SubscribeOptions> subscrToProp1 = { SubscribeOptions { .propId = PROP1, .vehicleAreas = toInt(VehicleAreaZone::ROW_1_LEFT), .flags = SubscribeFlags::HAL_EVENT }, }); }; hidl_vec<SubscribeOptions> subscrToProp2 = init_hidl_vec( { hidl_vec<SubscribeOptions> subscrToProp2 = { SubscribeOptions { .propId = PROP2, .flags = SubscribeFlags::HAL_EVENT }, }); }; hidl_vec<SubscribeOptions> subscrToProp1and2 = init_hidl_vec( { hidl_vec<SubscribeOptions> subscrToProp1and2 = { SubscribeOptions { .propId = PROP1, .vehicleAreas = toInt(VehicleAreaZone::ROW_1_LEFT), Loading @@ -71,7 +68,7 @@ public: .propId = PROP2, .flags = SubscribeFlags::HAL_EVENT }, }); }; static std::list<sp<IVehicleCallback>> extractCallbacks( const std::list<sp<HalClient>>& clients) { Loading Loading @@ -144,14 +141,13 @@ TEST_F(SubscriptionManagerTest, mulipleSubscriptions) { // Same property, but different zone, to make sure we didn't unsubscribe // from previous zone. manager.addOrUpdateSubscription(cb1, init_hidl_vec( { manager.addOrUpdateSubscription(cb1, { SubscribeOptions { .propId = PROP1, .vehicleAreas = toInt(VehicleAreaZone::ROW_2), .flags = SubscribeFlags::DEFAULT } })); }); clients = manager.getSubscribedClients(PROP1, toInt(VehicleAreaZone::ROW_1_LEFT), Loading
vehicle/2.0/default/tests/VehicleHalManager_test.cpp +21 −24 Original line number Diff line number Diff line Loading @@ -182,8 +182,8 @@ public: }; TEST_F(VehicleHalManagerTest, getPropConfigs) { hidl_vec<VehicleProperty> properties = init_hidl_vec( { VehicleProperty::HVAC_FAN_SPEED,VehicleProperty::INFO_MAKE} ); hidl_vec<VehicleProperty> properties = { VehicleProperty::HVAC_FAN_SPEED, VehicleProperty::INFO_MAKE }; bool called = false; manager->getPropConfigs(properties, Loading @@ -197,7 +197,7 @@ TEST_F(VehicleHalManagerTest, getPropConfigs) { ASSERT_TRUE(called); // Verify callback received. called = false; manager->getPropConfigs(init_hidl_vec({VehicleProperty::HVAC_FAN_SPEED}), manager->getPropConfigs({ VehicleProperty::HVAC_FAN_SPEED }, [&called] (StatusCode status, const hidl_vec<VehiclePropConfig>& c) { ASSERT_EQ(StatusCode::OK, status); Loading Loading @@ -230,13 +230,12 @@ TEST_F(VehicleHalManagerTest, halErrorEvent) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = init_hidl_vec( { hidl_vec<SubscribeOptions> options = { SubscribeOptions { .propId = PROP, .flags = SubscribeFlags::DEFAULT }, }); }; StatusCode res = manager->subscribe(cb, options); ASSERT_EQ(StatusCode::OK, res); Loading @@ -249,13 +248,12 @@ TEST_F(VehicleHalManagerTest, subscribe) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = init_hidl_vec( { hidl_vec<SubscribeOptions> options = { SubscribeOptions { .propId = PROP, .flags = SubscribeFlags::DEFAULT }, }); } }; StatusCode res = manager->subscribe(cb, options); ASSERT_EQ(StatusCode::OK, res); Loading Loading @@ -291,13 +289,12 @@ TEST_F(VehicleHalManagerTest, subscribe_WriteOnly) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = init_hidl_vec( { hidl_vec<SubscribeOptions> options = { SubscribeOptions { .propId = PROP, .flags = SubscribeFlags::HAL_EVENT }, }); }; StatusCode res = manager->subscribe(cb, options); // Unable to subscribe on Hal Events for write-only properties. Loading
vehicle/2.0/default/tests/VehicleHalTestUtils.h +34 −34 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ const VehiclePropConfig kVehicleProperties[] = { .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = static_cast<int32_t>( VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), .minInt32Value = 1, Loading @@ -53,7 +53,7 @@ const VehiclePropConfig kVehicleProperties[] = { .minInt32Value = 1, .maxInt32Value = 5, } }), } }, // Write-only property Loading @@ -64,7 +64,7 @@ const VehiclePropConfig kVehicleProperties[] = { .permissionModel = VehiclePermissionModel::NO_RESTRICTION, .supportedAreas = static_cast<int32_t>( VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), .minInt32Value = 64, Loading @@ -74,7 +74,7 @@ const VehiclePropConfig kVehicleProperties[] = { .minInt32Value = 64, .maxInt32Value = 80, } }), } }, { Loading @@ -82,12 +82,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minFloatValue = 0, .maxFloatValue = 1.0 } }) } }, { Loading @@ -95,12 +95,12 @@ const VehiclePropConfig kVehicleProperties[] = { .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .permissionModel = VehiclePermissionModel::OEM_ONLY, .areaConfigs = init_hidl_vec({ .areaConfigs = { VehicleAreaConfig { .minInt32Value = 0, .maxInt32Value = 10 } }) } }, { Loading