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

Commit 6f34d363 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Do not log an error when app restriction file does not exist

Bug: 20040207
Change-Id: Ibd257388a185020258e36bddf5b451dc24c0b7ee
parent 3425dae8
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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 {
+4 −1
Original line number Diff line number Diff line
@@ -5050,7 +5050,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);
            }