Camera: Fix onCameraOpened/onCameraClosed callback
Add client package id in the CameraStatus interface, so that
addListener will return the currently opened cameras if the
client has the permission.
Bug: 193475498
Test: testCameraManagerListenerCallbacks
Change-Id: Ic78b80526c3f55a450caa54e27c3d36265b127b9
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index ca184a8..c6a9019 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -632,6 +632,12 @@
bool removeUnavailablePhysicalId(const String8& physicalId);
/**
+ * Set and get client package name.
+ */
+ void setClientPackage(const String8& clientPackage);
+ String8 getClientPackage() const;
+
+ /**
* Return the unavailable physical ids for this device.
*
* This method acquires mStatusLock.
@@ -643,6 +649,7 @@
const int mCost;
std::set<String8> mConflicting;
std::set<String8> mUnavailablePhysicalIds;
+ String8 mClientPackage;
mutable Mutex mStatusLock;
CameraParameters mShimParams;
const SystemCameraKind mSystemCameraKind;