Loading automotive/vehicle/2.0/Android.bp +6 −6 Original line number Diff line number Diff line Loading @@ -26,14 +26,15 @@ hidl_interface { "Obd2IgnitionMonitorKind", "Obd2SecondaryAirStatus", "Obd2SparkIgnitionMonitors", "PortLocationType", "StatusCode", "SubscribeFlags", "SubscribeOptions", "VehicleApPowerBootupReason", "VehicleApPowerSetState", "VehicleApPowerState", "VehicleApPowerStateConfigFlag", "VehicleApPowerStateIndex", "VehicleApPowerStateReq", "VehicleApPowerStateReqIndex", "VehicleApPowerStateReport", "VehicleApPowerStateShutdownParam", "VehicleArea", "VehicleAreaConfig", Loading @@ -41,12 +42,13 @@ hidl_interface { "VehicleAreaMirror", "VehicleAreaSeat", "VehicleAreaWindow", "VehicleAreaZone", "VehicleDisplay", "VehicleGear", "VehicleHvacFanDirection", "VehicleHwKeyInputAction", "VehicleIgnitionState", "VehicleLightState", "VehicleLightSwitch", "VehicleOilLevel", "VehiclePropConfig", "VehiclePropValue", Loading @@ -54,10 +56,8 @@ hidl_interface { "VehiclePropertyAccess", "VehiclePropertyChangeMode", "VehiclePropertyGroup", "VehiclePropertyOperation", "VehiclePropertyStatus", "VehiclePropertyType", "VehicleRadioConstants", "VehicleTurnSignal", "VehicleUnit", "VmsAvailabilityStateIntegerValuesIndex", Loading automotive/vehicle/2.0/IVehicleCallback.hal +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ interface IVehicleCallback { /** * This method gets called if the client was subscribed to a property using * SubscribeFlags::SET_CALL flag and IVehicle#set(...) method was called. * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. * * These events must be delivered to subscriber immediately without any * batching. Loading automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h +1 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ private: * VehiclePropValuePool pool; * auto v = pool.obtain(VehiclePropertyType::INT32); * v->propId = VehicleProperty::HVAC_FAN_SPEED; * v->areaId = VehicleAreaZone::ROW_1_LEFT; * v->areaId = VehicleAreaSeat::ROW_1_LEFT; * v->timestamp = elapsedRealtimeNano(); * v->value->int32Values[0] = 42; * Loading automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ StatusCode SubscriptionManager::addOrUpdateSubscription( addClientToPropMapLocked(opts.propId, client); if (SubscribeFlags::HAL_EVENT & opts.flags) { if (SubscribeFlags::EVENTS_FROM_CAR & opts.flags) { SubscribeOptions updated; if (updateHalEventSubscriptionLocked(opts, &updated)) { outUpdatedSubscriptions->push_back(updated); Loading automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp +7 −13 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ void VehicleHalManager::onHalPropertySetError(StatusCode errorCode, int32_t property, int32_t areaId) { const auto& clients = mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::HAL_EVENT); mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::EVENTS_FROM_CAR); for (auto client : clients) { client->getCallback()->onPropertySetError(errorCode, property, areaId); Loading @@ -224,8 +224,8 @@ void VehicleHalManager::onHalPropertySetError(StatusCode errorCode, } void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& values) { const auto& clientValues = mSubscriptionManager.distributeValuesToClients( values, SubscribeFlags::HAL_EVENT); const auto& clientValues = mSubscriptionManager.distributeValuesToClients(values, SubscribeFlags::EVENTS_FROM_CAR); for (const HalClientValues& cv : clientValues) { auto vecSize = cv.values.size(); Loading @@ -250,8 +250,7 @@ void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& } bool VehicleHalManager::isSampleRateFixed(VehiclePropertyChangeMode mode) { return (mode & VehiclePropertyChangeMode::ON_SET) || (mode & VehiclePropertyChangeMode::ON_CHANGE); return (mode & VehiclePropertyChangeMode::ON_CHANGE); } float VehicleHalManager::checkSampleRate(const VehiclePropConfig &config, Loading Loading @@ -281,7 +280,7 @@ bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config, SubscribeFlags flags) { bool isReadable = config.access & VehiclePropertyAccess::READ; if (!isReadable && (SubscribeFlags::HAL_EVENT & flags)) { if (!isReadable && (SubscribeFlags::EVENTS_FROM_CAR & flags)) { ALOGW("Cannot subscribe, property 0x%x is not readable", config.prop); return false; } Loading @@ -289,12 +288,6 @@ bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config, ALOGW("Cannot subscribe, property 0x%x is static", config.prop); return false; } //TODO: extend to support event notification for set from android if (config.changeMode == VehiclePropertyChangeMode::POLL) { ALOGW("Cannot subscribe, property 0x%x is poll only", config.prop); return false; } return true; } Loading @@ -317,7 +310,8 @@ bool VehicleHalManager::checkReadPermission(const VehiclePropConfig &config) con } void VehicleHalManager::handlePropertySetEvent(const VehiclePropValue& value) { auto clients = mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::SET_CALL); auto clients = mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::EVENTS_FROM_ANDROID); for (auto client : clients) { client->getCallback()->onPropertySet(value); } Loading Loading
automotive/vehicle/2.0/Android.bp +6 −6 Original line number Diff line number Diff line Loading @@ -26,14 +26,15 @@ hidl_interface { "Obd2IgnitionMonitorKind", "Obd2SecondaryAirStatus", "Obd2SparkIgnitionMonitors", "PortLocationType", "StatusCode", "SubscribeFlags", "SubscribeOptions", "VehicleApPowerBootupReason", "VehicleApPowerSetState", "VehicleApPowerState", "VehicleApPowerStateConfigFlag", "VehicleApPowerStateIndex", "VehicleApPowerStateReq", "VehicleApPowerStateReqIndex", "VehicleApPowerStateReport", "VehicleApPowerStateShutdownParam", "VehicleArea", "VehicleAreaConfig", Loading @@ -41,12 +42,13 @@ hidl_interface { "VehicleAreaMirror", "VehicleAreaSeat", "VehicleAreaWindow", "VehicleAreaZone", "VehicleDisplay", "VehicleGear", "VehicleHvacFanDirection", "VehicleHwKeyInputAction", "VehicleIgnitionState", "VehicleLightState", "VehicleLightSwitch", "VehicleOilLevel", "VehiclePropConfig", "VehiclePropValue", Loading @@ -54,10 +56,8 @@ hidl_interface { "VehiclePropertyAccess", "VehiclePropertyChangeMode", "VehiclePropertyGroup", "VehiclePropertyOperation", "VehiclePropertyStatus", "VehiclePropertyType", "VehicleRadioConstants", "VehicleTurnSignal", "VehicleUnit", "VmsAvailabilityStateIntegerValuesIndex", Loading
automotive/vehicle/2.0/IVehicleCallback.hal +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ interface IVehicleCallback { /** * This method gets called if the client was subscribed to a property using * SubscribeFlags::SET_CALL flag and IVehicle#set(...) method was called. * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. * * These events must be delivered to subscriber immediately without any * batching. Loading
automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h +1 −1 Original line number Diff line number Diff line Loading @@ -152,7 +152,7 @@ private: * VehiclePropValuePool pool; * auto v = pool.obtain(VehiclePropertyType::INT32); * v->propId = VehicleProperty::HVAC_FAN_SPEED; * v->areaId = VehicleAreaZone::ROW_1_LEFT; * v->areaId = VehicleAreaSeat::ROW_1_LEFT; * v->timestamp = elapsedRealtimeNano(); * v->value->int32Values[0] = 42; * Loading
automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -106,7 +106,7 @@ StatusCode SubscriptionManager::addOrUpdateSubscription( addClientToPropMapLocked(opts.propId, client); if (SubscribeFlags::HAL_EVENT & opts.flags) { if (SubscribeFlags::EVENTS_FROM_CAR & opts.flags) { SubscribeOptions updated; if (updateHalEventSubscriptionLocked(opts, &updated)) { outUpdatedSubscriptions->push_back(updated); Loading
automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp +7 −13 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ void VehicleHalManager::onHalPropertySetError(StatusCode errorCode, int32_t property, int32_t areaId) { const auto& clients = mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::HAL_EVENT); mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::EVENTS_FROM_CAR); for (auto client : clients) { client->getCallback()->onPropertySetError(errorCode, property, areaId); Loading @@ -224,8 +224,8 @@ void VehicleHalManager::onHalPropertySetError(StatusCode errorCode, } void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& values) { const auto& clientValues = mSubscriptionManager.distributeValuesToClients( values, SubscribeFlags::HAL_EVENT); const auto& clientValues = mSubscriptionManager.distributeValuesToClients(values, SubscribeFlags::EVENTS_FROM_CAR); for (const HalClientValues& cv : clientValues) { auto vecSize = cv.values.size(); Loading @@ -250,8 +250,7 @@ void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& } bool VehicleHalManager::isSampleRateFixed(VehiclePropertyChangeMode mode) { return (mode & VehiclePropertyChangeMode::ON_SET) || (mode & VehiclePropertyChangeMode::ON_CHANGE); return (mode & VehiclePropertyChangeMode::ON_CHANGE); } float VehicleHalManager::checkSampleRate(const VehiclePropConfig &config, Loading Loading @@ -281,7 +280,7 @@ bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config, SubscribeFlags flags) { bool isReadable = config.access & VehiclePropertyAccess::READ; if (!isReadable && (SubscribeFlags::HAL_EVENT & flags)) { if (!isReadable && (SubscribeFlags::EVENTS_FROM_CAR & flags)) { ALOGW("Cannot subscribe, property 0x%x is not readable", config.prop); return false; } Loading @@ -289,12 +288,6 @@ bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config, ALOGW("Cannot subscribe, property 0x%x is static", config.prop); return false; } //TODO: extend to support event notification for set from android if (config.changeMode == VehiclePropertyChangeMode::POLL) { ALOGW("Cannot subscribe, property 0x%x is poll only", config.prop); return false; } return true; } Loading @@ -317,7 +310,8 @@ bool VehicleHalManager::checkReadPermission(const VehiclePropConfig &config) con } void VehicleHalManager::handlePropertySetEvent(const VehiclePropValue& value) { auto clients = mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::SET_CALL); auto clients = mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::EVENTS_FROM_ANDROID); for (auto client : clients) { client->getCallback()->onPropertySet(value); } Loading