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

Commit fc9b7c84 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11876238 from d89968f7 to 24Q3-release

Change-Id: Ia04590653975df437a9807816371ab17e10a177f
parents 2222c01e d89968f7
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -51,9 +51,7 @@ digraph stream_out_async_state_machine {
    DRAIN_PAUSED -> DRAINING [label="start"];         // consumer -> active
    DRAIN_PAUSED -> TRANSFER_PAUSED [label="burst"];  // producer -> active
    DRAIN_PAUSED -> IDLE [label="flush"];             // buffer is cleared
    IDLE -> ERROR [label="←IStreamCallback.onError"];
    DRAINING -> ERROR [label="←IStreamCallback.onError"];
    TRANSFERRING -> ERROR [label="←IStreamCallback.onError"];
    ANY_STATE -> ERROR [label="←IStreamCallback.onError"];
    ANY_STATE -> CLOSED [label="→IStream*.close"];
    CLOSED -> F;
}
+21 −0
Original line number Diff line number Diff line
@@ -45,3 +45,24 @@ prebuilt_etc {
    sub_dir: "automotive/vhalconfig/",
    vendor: true,
}

prebuilt_etc_host {
    name: "Host_Prebuilt_VehicleHalDefaultProperties_JSON",
    filename_from_src: true,
    src: "DefaultProperties.json",
    relative_install_path: "automotive/vhalconfig/",
}

prebuilt_etc_host {
    name: "Host_Prebuilt_VehicleHalTestProperties_JSON",
    filename_from_src: true,
    src: "TestProperties.json",
    relative_install_path: "automotive/vhalconfig/",
}

prebuilt_etc_host {
    name: "Host_Prebuilt_VehicleHalVendorClusterTestProperties_JSON",
    filename_from_src: true,
    src: "VendorClusterTestProperties.json",
    relative_install_path: "automotive/vhalconfig/",
}
+2 −0
Original line number Diff line number Diff line
@@ -56,6 +56,8 @@ cc_test {
    defaults: [
        "VehicleHalDefaults",
    ],
    // Need root to use vendor lib: libgrpc++.
    require_root: true,
    test_suites: ["device-tests"],
}

+19 −0
Original line number Diff line number Diff line
@@ -206,6 +206,25 @@ aidlvhal::StatusCode GRPCVehicleHardware::subscribe(aidlvhal::SubscribeOptions o
    return static_cast<aidlvhal::StatusCode>(protoStatus.status_code());
}

aidlvhal::StatusCode GRPCVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) {
    proto::UnsubscribeRequest request;
    ::grpc::ClientContext context;
    proto::VehicleHalCallStatus protoStatus;
    request.set_prop_id(propId);
    request.set_area_id(areaId);
    auto grpc_status = mGrpcStub->Unsubscribe(&context, request, &protoStatus);
    if (!grpc_status.ok()) {
        if (grpc_status.error_code() == ::grpc::StatusCode::UNIMPLEMENTED) {
            // This is a legacy sever. Ignore unsubscribe request.
            LOG(INFO) << __func__ << ": GRPC Unsubscribe is not supported by the server";
            return aidlvhal::StatusCode::OK;
        }
        LOG(ERROR) << __func__ << ": GRPC Unsubscribe Failed: " << grpc_status.error_message();
        return aidlvhal::StatusCode::INTERNAL_ERROR;
    }
    return static_cast<aidlvhal::StatusCode>(protoStatus.status_code());
}

aidlvhal::StatusCode GRPCVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId,
                                                           float sampleRate) {
    ::grpc::ClientContext context;
+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ class GRPCVehicleHardware : public IVehicleHardware {

    aidlvhal::StatusCode subscribe(aidlvhal::SubscribeOptions options) override;

    aidlvhal::StatusCode unsubscribe(int32_t propId, int32_t areaId) override;

    bool waitForConnected(std::chrono::milliseconds waitTime);

  protected:
Loading