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

Commit 1a166646 authored by Adam Bookatz's avatar Adam Bookatz Committed by Automerger Merge Worker
Browse files

Merge "UserManagerService.hasManagedProfile fix" into tm-dev am: 7be53032

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17012898

Change-Id: I2897d518eda117b2a04fc46643af56ee7f273062
parents fc850412 7be53032
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2812,8 +2812,8 @@ public class ComputerEngine implements Computer {
                    "MATCH_ANY_USER flag requires INTERACT_ACROSS_USERS permission");
        } else if ((flags & PackageManager.MATCH_UNINSTALLED_PACKAGES) != 0
                && isCallerSystemUser
                && mUserManager.hasManagedProfile(UserHandle.USER_SYSTEM)) {
            // If the caller wants all packages and has a restricted profile associated with it,
                && mUserManager.hasProfile(UserHandle.USER_SYSTEM)) {
            // 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
            //work
            // profile apps don't start breaking. TODO: Remove this hack when launchers stop
+2 −2
Original line number Diff line number Diff line
@@ -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
     * @return
     */
    boolean hasManagedProfile(@UserIdInt int userId) {
    boolean hasProfile(@UserIdInt int userId) {
        synchronized (mUsersLock) {
            UserInfo userInfo = getUserInfoLU(userId);
            final int userSize = mUsers.size();