CameraService: Check if the camera is disabled via device policy by user.
The current approach to checking the camera device policy is multi-user
agnostic. This patch takes the user into account.
Test: Tested GCA with device policy set via TestDPC
Bug: 230026863
Change-Id: I3937f75ebfc219906a3c379b6b4cfacd801a40bf
diff --git a/services/camera/libcameraservice/tests/CameraPermissionsTest.cpp b/services/camera/libcameraservice/tests/CameraPermissionsTest.cpp
index 4359f9b..42d99e8 100644
--- a/services/camera/libcameraservice/tests/CameraPermissionsTest.cpp
+++ b/services/camera/libcameraservice/tests/CameraPermissionsTest.cpp
@@ -138,12 +138,12 @@
return mCameraServiceProxy->notifyCameraState(cameraSessionStats);
}
- virtual binder::Status isCameraDisabled(bool *ret) override {
+ virtual binder::Status isCameraDisabled(int userId, bool *ret) override {
if (mOverrideCameraDisabled) {
*ret = mCameraDisabled;
return binder::Status::ok();
}
- return mCameraServiceProxy->isCameraDisabled(ret);
+ return mCameraServiceProxy->isCameraDisabled(userId, ret);
}
void setCameraDisabled(bool cameraDisabled) {
@@ -167,7 +167,7 @@
{ }
~AutoDisconnectDevice() {
- if (mDevice != nullptr) {
+ if (mDevice != nullptr) {
mDevice->disconnect();
}
}