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

Commit 88fe6bc7 authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by android-build-merger
Browse files

Merge "Delay grantDefaultPermissions until user\'s first start" into nyc-dev

am: 6eb923cb

* commit '6eb923cb':
  Delay grantDefaultPermissions until user's first start

Change-Id: I1924078f6a3e893e07840ba4c80bb59bd1036d7e
parents 74aac8d9 6eb923cb
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -20076,8 +20076,13 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
        }
    }
    void newUserCreated(final int userHandle) {
        mDefaultPermissionPolicy.grantDefaultPermissions(userHandle);
    void onBeforeUserStartUninitialized(final int userId) {
        synchronized (mPackages) {
            if (mSettings.areDefaultRuntimePermissionsGrantedLPr(userId)) {
                return;
            }
        }
        mDefaultPermissionPolicy.grantDefaultPermissions(userId);
        // If permission review for legacy apps is required, we represent
        // dagerous permissions for such apps as always granted runtime
        // permissions to keep per user flag state whether review is needed.
+4 −2
Original line number Diff line number Diff line

/*
 * Copyright (C) 2011 The Android Open Source Project
 *
@@ -2074,7 +2073,6 @@ public class UserManagerService extends IUserManager.Stub {
            synchronized (mRestrictionsLock) {
                mBaseUserRestrictions.append(userId, restrictions);
            }
            mPm.newUserCreated(userId);
            Intent addedIntent = new Intent(Intent.ACTION_USER_ADDED);
            addedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
            mContext.sendBroadcastAsUser(addedIntent, UserHandle.ALL,
@@ -2634,6 +2632,10 @@ public class UserManagerService extends IUserManager.Stub {
            synchronized (mRestrictionsLock) {
                applyUserRestrictionsLR(userId);
            }
            UserInfo userInfo = getUserInfoNoChecks(userId);
            if (userInfo != null && !userInfo.isInitialized()) {
                mPm.onBeforeUserStartUninitialized(userId);
            }
        }
    }