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

Commit 25da6b65 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by Android (Google) Code Review
Browse files

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

parents 73e5f13d 6f34d363
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
@@ -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);
            }