Camera: Synchronize callback access to composite map
Access to the camera device client composite map is not
thread safe during device callbacks. To avoid possible
deadlocks, synchronize access to the map via separate
dedicated lock.
Additionally correct the composite graphic producer query
when switching to offline mode.
Bug: 212496312
Test: Camera CTS, partner testing
Change-Id: I25b24466fbcf88a85d1c28b874812ff5c102c250
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.h b/services/camera/libcameraservice/api2/CameraDeviceClient.h
index 77cdf9c..1b0c61a 100644
--- a/services/camera/libcameraservice/api2/CameraDeviceClient.h
+++ b/services/camera/libcameraservice/api2/CameraDeviceClient.h
@@ -339,6 +339,8 @@
// set of high resolution camera id (logical / physical)
std::unordered_set<std::string> mHighResolutionSensors;
+ // Synchronize access to 'mCompositeStreamMap'
+ Mutex mCompositeLock;
KeyedVector<sp<IBinder>, sp<CompositeStream>> mCompositeStreamMap;
sp<CameraProviderManager> mProviderManager;