Check the device policy for the camera disabled flag before trying to
open a connection to the camera.
When the camera is disabled from both the device policy and camera
settings, GCA will not receive onError with ERROR_CAMERA_DISABLED. This
is incorrect behavior which is fixed by this patch.
Bug: 230026863, 203063139
Test: Verified camera app closes when both settings are disabled.
Change-Id: I514b38c23a136994de702ea4aacc9be65ab46d70
diff --git a/camera/aidl/android/hardware/ICameraServiceProxy.aidl b/camera/aidl/android/hardware/ICameraServiceProxy.aidl
index f5d0120..88783fb 100644
--- a/camera/aidl/android/hardware/ICameraServiceProxy.aidl
+++ b/camera/aidl/android/hardware/ICameraServiceProxy.aidl
@@ -44,4 +44,9 @@
* {@link android.hardware.camera2.CameraMetadata#SCALER_ROTATE_AND_CROP_270}).
*/
int getRotateAndCropOverride(String packageName, int lensFacing, int userId);
+
+ /**
+ * Checks if the camera has been disabled via device policy.
+ */
+ boolean isCameraDisabled();
}