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

Commit 2d68d3ee authored by Yu Shan's avatar Yu Shan
Browse files

Address minor comments.

Minor improvement to VHAL logic in responding to code comments at
ag/31125664.

Flag: EXEMPT HAL change
Test: Presubmit
Bug: 382563296
Change-Id: I473360d8e3ace7bb4803a5651f1e67906147b7d0
parent ef49e73f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ class SubscriptionClient {

    // Invokes onSupportedValueChange callback.
    static void sendSupportedValueChangeEvents(CallbackType callback,
                                               std::vector<PropIdAreaId> propIdAreaIds);
                                               const std::vector<PropIdAreaId>& propIdAreaIds);
};

}  // namespace vehicle
+4 −4
Original line number Diff line number Diff line
@@ -306,8 +306,9 @@ void SubscriptionClient::sendPropertySetErrors(std::shared_ptr<IVehicleCallback>
    }
}

void SubscriptionClient::sendSupportedValueChangeEvents(std::shared_ptr<IVehicleCallback> callback,
                                                        std::vector<PropIdAreaId> propIdAreaIds) {
void SubscriptionClient::sendSupportedValueChangeEvents(
        std::shared_ptr<IVehicleCallback> callback,
        const std::vector<PropIdAreaId>& propIdAreaIds) {
    if (propIdAreaIds.empty()) {
        return;
    }
@@ -323,8 +324,7 @@ void SubscriptionClient::sendSupportedValueChangeEvents(std::shared_ptr<IVehicle
    if (ScopedAStatus callbackStatus = callback->onSupportedValueChange(vhalPropIdAreaIds);
        !callbackStatus.isOk()) {
        ALOGE("subscribe: failed to call onSupportedValueChange callback, client ID: %p, error: "
              "%s, "
              "exception: %d, service specific error: %d",
              "%s, exception: %d, service specific error: %d",
              callback->asBinder().get(), callbackStatus.getMessage(),
              callbackStatus.getExceptionCode(), callbackStatus.getServiceSpecificError());
    }
+1 −2
Original line number Diff line number Diff line
@@ -263,8 +263,7 @@ void DefaultVehicleHal::onSupportedValueChange(
    auto updatedPropIdAreaIdsByClient =
            manager->getSubscribedClientsForSupportedValueChange(propIdAreaIds);
    for (auto& [callback, updatedPropIdAreaIds] : updatedPropIdAreaIdsByClient) {
        SubscriptionClient::sendSupportedValueChangeEvents(callback,
                                                           std::move(updatedPropIdAreaIds));
        SubscriptionClient::sendSupportedValueChangeEvents(callback, updatedPropIdAreaIds);
    }
}