Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55fe1361 authored by Steve Paik's avatar Steve Paik Committed by android-build-merger
Browse files

Merge "Update VHAL types.hal" into pi-dev

am: 1058b982

Change-Id: I9001e90f76a1cf18cb88fd5a65e2f8f4602073fd
parents 71641ca3 1058b982
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -26,14 +26,15 @@ hidl_interface {
        "Obd2IgnitionMonitorKind",
        "Obd2SecondaryAirStatus",
        "Obd2SparkIgnitionMonitors",
        "PortLocationType",
        "StatusCode",
        "SubscribeFlags",
        "SubscribeOptions",
        "VehicleApPowerBootupReason",
        "VehicleApPowerSetState",
        "VehicleApPowerState",
        "VehicleApPowerStateConfigFlag",
        "VehicleApPowerStateIndex",
        "VehicleApPowerStateReq",
        "VehicleApPowerStateReqIndex",
        "VehicleApPowerStateReport",
        "VehicleApPowerStateShutdownParam",
        "VehicleArea",
        "VehicleAreaConfig",
@@ -41,12 +42,13 @@ hidl_interface {
        "VehicleAreaMirror",
        "VehicleAreaSeat",
        "VehicleAreaWindow",
        "VehicleAreaZone",
        "VehicleDisplay",
        "VehicleGear",
        "VehicleHvacFanDirection",
        "VehicleHwKeyInputAction",
        "VehicleIgnitionState",
        "VehicleLightState",
        "VehicleLightSwitch",
        "VehicleOilLevel",
        "VehiclePropConfig",
        "VehiclePropValue",
@@ -54,10 +56,8 @@ hidl_interface {
        "VehiclePropertyAccess",
        "VehiclePropertyChangeMode",
        "VehiclePropertyGroup",
        "VehiclePropertyOperation",
        "VehiclePropertyStatus",
        "VehiclePropertyType",
        "VehicleRadioConstants",
        "VehicleTurnSignal",
        "VehicleUnit",
        "VmsAvailabilityStateIntegerValuesIndex",
+1 −1
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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;
 *
+1 −1
Original line number Diff line number Diff line
@@ -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);
+7 −13
Original line number Diff line number Diff line
@@ -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);
@@ -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();
@@ -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,
@@ -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;
    }
@@ -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;
}

@@ -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