From 514c23cad5133166d615df602be11f17ecac8f29 Mon Sep 17 00:00:00 2001 From: Aaqib Ismail Date: Tue, 19 Sep 2023 17:55:01 -0700 Subject: [PATCH] Make event callback accessible to child classes Bug: 291278377 Test: m Change-Id: Idb667aa847ba566713068a47b12dc849ffcf96cc --- automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h index e740da7e5c..ddd620ea2e 100644 --- a/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h +++ b/automotive/vehicle/aidl/impl/grpc/GRPCVehicleHardware.h @@ -82,6 +82,10 @@ class GRPCVehicleHardware : public IVehicleHardware { bool waitForConnected(std::chrono::milliseconds waitTime); + protected: + std::shared_mutex mCallbackMutex; + std::unique_ptr mOnPropChange; + private: void ValuePollingLoop(); @@ -90,8 +94,6 @@ class GRPCVehicleHardware : public IVehicleHardware { std::unique_ptr mGrpcStub; std::thread mValuePollingThread; - std::shared_mutex mCallbackMutex; - std::unique_ptr mOnPropChange; std::unique_ptr mOnSetErr; std::mutex mShutdownMutex;