Loading services/core/java/com/android/server/camera/CameraServiceProxy.java +7 −2 Original line number Diff line number Diff line Loading @@ -582,13 +582,18 @@ public class CameraServiceProxy extends SystemService } @Override public boolean isCameraDisabled() { public boolean isCameraDisabled(int userId) { DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); if (dpm == null) { Slog.e(TAG, "Failed to get the device policy manager service"); return false; } return dpm.getCameraDisabled(null); try { return dpm.getCameraDisabled(null, userId); } catch (Exception e) { e.printStackTrace(); return false; } } }; Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +6 −1 Original line number Diff line number Diff line Loading @@ -8144,7 +8144,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle) || isCameraServerUid(caller)); if (parent) { Preconditions.checkCallAuthorization( Loading Loading @@ -9666,6 +9667,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return UserHandle.isSameApp(caller.getUid(), Process.SHELL_UID); } private boolean isCameraServerUid(CallerIdentity caller) { return UserHandle.isSameApp(caller.getUid(), Process.CAMERASERVER_UID); } private @UserIdInt int getCurrentForegroundUserId() { try { UserInfo currentUser = mInjector.getIActivityManager().getCurrentUser(); Loading Loading
services/core/java/com/android/server/camera/CameraServiceProxy.java +7 −2 Original line number Diff line number Diff line Loading @@ -582,13 +582,18 @@ public class CameraServiceProxy extends SystemService } @Override public boolean isCameraDisabled() { public boolean isCameraDisabled(int userId) { DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); if (dpm == null) { Slog.e(TAG, "Failed to get the device policy manager service"); return false; } return dpm.getCameraDisabled(null); try { return dpm.getCameraDisabled(null, userId); } catch (Exception e) { e.printStackTrace(); return false; } } }; Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +6 −1 Original line number Diff line number Diff line Loading @@ -8144,7 +8144,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { } final CallerIdentity caller = getCallerIdentity(who); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle)); Preconditions.checkCallAuthorization(hasFullCrossUsersPermission(caller, userHandle) || isCameraServerUid(caller)); if (parent) { Preconditions.checkCallAuthorization( Loading Loading @@ -9666,6 +9667,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return UserHandle.isSameApp(caller.getUid(), Process.SHELL_UID); } private boolean isCameraServerUid(CallerIdentity caller) { return UserHandle.isSameApp(caller.getUid(), Process.CAMERASERVER_UID); } private @UserIdInt int getCurrentForegroundUserId() { try { UserInfo currentUser = mInjector.getIActivityManager().getCurrentUser(); Loading