Merge "UserManagerService.hasManagedProfile fix" into tm-dev
This commit is contained in:
@@ -2812,8 +2812,8 @@ public class ComputerEngine implements Computer {
|
|||||||
"MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission");
|
"MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission");
|
||||||
} else if ((flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0
|
} else if ((flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0
|
||||||
&& isCallerSystemUser
|
&& isCallerSystemUser
|
||||||
&& mUserManager.hasManagedProfile(UserHandle.USER_SYSTEM)) {
|
&& mUserManager.hasProfile(UserHandle.USER_SYSTEM)) {
|
||||||
// If the caller wants all packages and has a restricted profile associated with it,
|
// If the caller wants all packages and has a profile associated with it,
|
||||||
// then match all users. This is to make sure that launchers that need to access
|
// then match all users. This is to make sure that launchers that need to access
|
||||||
//work
|
//work
|
||||||
// profile apps don't start breaking. TODO: Remove this hack when launchers stop
|
// profile apps don't start breaking. TODO: Remove this hack when launchers stop
|
||||||
|
|||||||
@@ -6263,11 +6263,11 @@ public class UserManagerService extends IUserManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given user has a managed profile associated with it.
|
* Checks if the given user has a profile associated with it.
|
||||||
* @param userId The parent user
|
* @param userId The parent user
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean hasManagedProfile(@UserIdInt int userId) {
|
boolean hasProfile(@UserIdInt int userId) {
|
||||||
synchronized (mUsersLock) {
|
synchronized (mUsersLock) {
|
||||||
UserInfo userInfo = getUserInfoLU(userId);
|
UserInfo userInfo = getUserInfoLU(userId);
|
||||||
final int userSize = mUsers.size();
|
final int userSize = mUsers.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user