Loading services/core/java/com/android/server/pm/UserManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -1689,6 +1689,9 @@ public class UserManagerService extends IUserManager.Stub { static Bundle readApplicationRestrictionsLocked(AtomicFile restrictionsFile) { final Bundle restrictions = new Bundle(); final ArrayList<String> values = new ArrayList<>(); if (!restrictionsFile.getBaseFile().exists()) { return null; } FileInputStream fis = null; try { Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -5063,7 +5063,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { long id = Binder.clearCallingIdentity(); try { return mUserManager.getApplicationRestrictions(packageName, userHandle); Bundle bundle = mUserManager.getApplicationRestrictions(packageName, userHandle); // if no restrictions were saved, mUserManager.getApplicationRestrictions // returns null, but DPM method should return an empty Bundle as per JavaDoc return bundle != null ? bundle : Bundle.EMPTY; } finally { restoreCallingIdentity(id); } Loading Loading
services/core/java/com/android/server/pm/UserManagerService.java +3 −0 Original line number Diff line number Diff line Loading @@ -1689,6 +1689,9 @@ public class UserManagerService extends IUserManager.Stub { static Bundle readApplicationRestrictionsLocked(AtomicFile restrictionsFile) { final Bundle restrictions = new Bundle(); final ArrayList<String> values = new ArrayList<>(); if (!restrictionsFile.getBaseFile().exists()) { return null; } FileInputStream fis = null; try { Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +4 −1 Original line number Diff line number Diff line Loading @@ -5063,7 +5063,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { long id = Binder.clearCallingIdentity(); try { return mUserManager.getApplicationRestrictions(packageName, userHandle); Bundle bundle = mUserManager.getApplicationRestrictions(packageName, userHandle); // if no restrictions were saved, mUserManager.getApplicationRestrictions // returns null, but DPM method should return an empty Bundle as per JavaDoc return bundle != null ? bundle : Bundle.EMPTY; } finally { restoreCallingIdentity(id); } Loading