Merge "Delay grantDefaultPermissions until user\'s first start" into nyc-dev am: 6eb923cb64
am: 89033ea614
* commit '89033ea614fe70730172749b6444f78705b66fad':
Delay grantDefaultPermissions until user's first start
Change-Id: Ic57a83d54fef35ecc3b9f4a41008d07877a1b814
This commit is contained in:
@@ -20076,8 +20076,13 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void newUserCreated(final int userHandle) {
|
void onBeforeUserStartUninitialized(final int userId) {
|
||||||
mDefaultPermissionPolicy.grantDefaultPermissions(userHandle);
|
synchronized (mPackages) {
|
||||||
|
if (mSettings.areDefaultRuntimePermissionsGrantedLPr(userId)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mDefaultPermissionPolicy.grantDefaultPermissions(userId);
|
||||||
// If permission review for legacy apps is required, we represent
|
// If permission review for legacy apps is required, we represent
|
||||||
// dagerous permissions for such apps as always granted runtime
|
// dagerous permissions for such apps as always granted runtime
|
||||||
// permissions to keep per user flag state whether review is needed.
|
// permissions to keep per user flag state whether review is needed.
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2011 The Android Open Source Project
|
* Copyright (C) 2011 The Android Open Source Project
|
||||||
*
|
*
|
||||||
@@ -2074,7 +2073,6 @@ public class UserManagerService extends IUserManager.Stub {
|
|||||||
synchronized (mRestrictionsLock) {
|
synchronized (mRestrictionsLock) {
|
||||||
mBaseUserRestrictions.append(userId, restrictions);
|
mBaseUserRestrictions.append(userId, restrictions);
|
||||||
}
|
}
|
||||||
mPm.newUserCreated(userId);
|
|
||||||
Intent addedIntent = new Intent(Intent.ACTION_USER_ADDED);
|
Intent addedIntent = new Intent(Intent.ACTION_USER_ADDED);
|
||||||
addedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
|
addedIntent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
|
||||||
mContext.sendBroadcastAsUser(addedIntent, UserHandle.ALL,
|
mContext.sendBroadcastAsUser(addedIntent, UserHandle.ALL,
|
||||||
@@ -2634,6 +2632,10 @@ public class UserManagerService extends IUserManager.Stub {
|
|||||||
synchronized (mRestrictionsLock) {
|
synchronized (mRestrictionsLock) {
|
||||||
applyUserRestrictionsLR(userId);
|
applyUserRestrictionsLR(userId);
|
||||||
}
|
}
|
||||||
|
UserInfo userInfo = getUserInfoNoChecks(userId);
|
||||||
|
if (userInfo != null && !userInfo.isInitialized()) {
|
||||||
|
mPm.onBeforeUserStartUninitialized(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user