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

Commit 6cc59823 authored by Austin Borger's avatar Austin Borger Committed by Gerrit Code Review
Browse files

Merge "Camera: Clear identity before access device policy manager" into main

parents 51bf3fd5 cf72d72c
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -595,6 +595,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");
@@ -606,6 +613,9 @@ public class CameraServiceProxy extends SystemService
                    e.printStackTrace();
                    return false;
                }
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    };