Merge "Call isUserUnlockingOrUnlocked with cleared identity" into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b7bd2e645d
@@ -677,16 +677,17 @@ class ActivityStarter {
|
|||||||
// app in a locked managed profile from an unlocked parent allow it to resolve
|
// app in a locked managed profile from an unlocked parent allow it to resolve
|
||||||
// as user will be sent via confirm credentials to unlock the profile.
|
// as user will be sent via confirm credentials to unlock the profile.
|
||||||
UserManager userManager = UserManager.get(mService.mContext);
|
UserManager userManager = UserManager.get(mService.mContext);
|
||||||
UserInfo parent = null;
|
boolean profileLockedAndParentUnlockingOrUnlocked = false;
|
||||||
long token = Binder.clearCallingIdentity();
|
long token = Binder.clearCallingIdentity();
|
||||||
try {
|
try {
|
||||||
parent = userManager.getProfileParent(userId);
|
UserInfo parent = userManager.getProfileParent(userId);
|
||||||
|
profileLockedAndParentUnlockingOrUnlocked = (parent != null)
|
||||||
|
&& userManager.isUserUnlockingOrUnlocked(parent.id)
|
||||||
|
&& !userManager.isUserUnlockingOrUnlocked(userId);
|
||||||
} finally {
|
} finally {
|
||||||
Binder.restoreCallingIdentity(token);
|
Binder.restoreCallingIdentity(token);
|
||||||
}
|
}
|
||||||
if (parent != null
|
if (profileLockedAndParentUnlockingOrUnlocked) {
|
||||||
&& userManager.isUserUnlockingOrUnlocked(parent.getUserHandle())
|
|
||||||
&& !userManager.isUserUnlockingOrUnlocked(userInfo.getUserHandle())) {
|
|
||||||
rInfo = mSupervisor.resolveIntent(intent, resolvedType, userId,
|
rInfo = mSupervisor.resolveIntent(intent, resolvedType, userId,
|
||||||
PackageManager.MATCH_DIRECT_BOOT_AWARE
|
PackageManager.MATCH_DIRECT_BOOT_AWARE
|
||||||
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE);
|
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE);
|
||||||
|
|||||||
Reference in New Issue
Block a user