Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f29c879c authored by Austin Borger's avatar Austin Borger Committed by Android (Google) Code Review
Browse files

Merge "Camera: Clear identity before access device policy manager" into udc-qpr-dev

parents 43c450a1 090529b1
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -613,6 +613,13 @@ public class CameraServiceProxy extends SystemService

        @Override
        public boolean isCameraDisabled(int userId) {
            if (Binder.getCallingUid() != Process.CAMERASERVER_UID) {
                Slog.e(TAG, "Calling UID: " + Binder.getCallingUid()
                        + " doesn't match expected camera service UID!");
                return false;
            }
            final long ident = Binder.clearCallingIdentity();
            try {
                DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class);
                if (dpm == null) {
                    Slog.e(TAG, "Failed to get the device policy manager service");
@@ -624,6 +631,9 @@ public class CameraServiceProxy extends SystemService
                    e.printStackTrace();
                    return false;
                }
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    };