Loading services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1912,7 +1912,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub void updateCurrentProfileIds() { mSettings.setCurrentProfileIds( mUserManager.getProfileIdsWithDisabled(mSettings.getCurrentUserId())); mUserManagerInternal.getProfileIds(mSettings.getCurrentUserId(), false /* enabledOnly */)); } @Override Loading Loading @@ -3652,7 +3653,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub scheduleSwitchUserTaskLocked(userId, cs.mClient); return InputBindResult.USER_SWITCHING; } for (int profileId : mUserManager.getProfileIdsWithDisabled(nextUserId)) { final int[] profileIdsWithDisabled = mUserManagerInternal.getProfileIds( mSettings.getCurrentUserId(), false /* enabledOnly */); for (int profileId : profileIdsWithDisabled) { if (profileId == userId) { scheduleSwitchUserTaskLocked(userId, cs.mClient); return InputBindResult.USER_SWITCHING; Loading services/core/java/com/android/server/pm/UserManagerInternal.java +12 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,18 @@ public abstract class UserManagerInternal { public abstract @NonNull List<UserInfo> getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated); /** * Returns an array of ids for profiles associated with the specified user including the user * itself. * <p>Note that this includes all profile types (not including Restricted profiles). * * @param userId id of the user to return profiles for * @param enabledOnly whether return only {@link UserInfo#isEnabled() enabled} profiles * @return A non-empty array of ids of profiles associated with the specified user if the user * exists. Otherwise, an empty array. */ public abstract @NonNull int[] getProfileIds(@UserIdInt int userId, boolean enabledOnly); /** * Checks if the {@code callingUserId} and {@code targetUserId} are same or in same group * and that the {@code callingUserId} is not a profile and {@code targetUserId} is enabled. Loading services/core/java/com/android/server/pm/UserManagerService.java +7 −0 Original line number Diff line number Diff line Loading @@ -6699,6 +6699,13 @@ public class UserManagerService extends IUserManager.Stub { excludePreCreated); } @Override public @NonNull int[] getProfileIds(@UserIdInt int userId, boolean enabledOnly) { synchronized (mUsersLock) { return getProfileIdsLU(userId, null /* userType */, enabledOnly).toArray(); } } @Override public boolean isUserUnlockingOrUnlocked(@UserIdInt int userId) { int state; Loading Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -1912,7 +1912,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub void updateCurrentProfileIds() { mSettings.setCurrentProfileIds( mUserManager.getProfileIdsWithDisabled(mSettings.getCurrentUserId())); mUserManagerInternal.getProfileIds(mSettings.getCurrentUserId(), false /* enabledOnly */)); } @Override Loading Loading @@ -3652,7 +3653,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub scheduleSwitchUserTaskLocked(userId, cs.mClient); return InputBindResult.USER_SWITCHING; } for (int profileId : mUserManager.getProfileIdsWithDisabled(nextUserId)) { final int[] profileIdsWithDisabled = mUserManagerInternal.getProfileIds( mSettings.getCurrentUserId(), false /* enabledOnly */); for (int profileId : profileIdsWithDisabled) { if (profileId == userId) { scheduleSwitchUserTaskLocked(userId, cs.mClient); return InputBindResult.USER_SWITCHING; Loading
services/core/java/com/android/server/pm/UserManagerInternal.java +12 −0 Original line number Diff line number Diff line Loading @@ -247,6 +247,18 @@ public abstract class UserManagerInternal { public abstract @NonNull List<UserInfo> getUsers(boolean excludePartial, boolean excludeDying, boolean excludePreCreated); /** * Returns an array of ids for profiles associated with the specified user including the user * itself. * <p>Note that this includes all profile types (not including Restricted profiles). * * @param userId id of the user to return profiles for * @param enabledOnly whether return only {@link UserInfo#isEnabled() enabled} profiles * @return A non-empty array of ids of profiles associated with the specified user if the user * exists. Otherwise, an empty array. */ public abstract @NonNull int[] getProfileIds(@UserIdInt int userId, boolean enabledOnly); /** * Checks if the {@code callingUserId} and {@code targetUserId} are same or in same group * and that the {@code callingUserId} is not a profile and {@code targetUserId} is enabled. Loading
services/core/java/com/android/server/pm/UserManagerService.java +7 −0 Original line number Diff line number Diff line Loading @@ -6699,6 +6699,13 @@ public class UserManagerService extends IUserManager.Stub { excludePreCreated); } @Override public @NonNull int[] getProfileIds(@UserIdInt int userId, boolean enabledOnly) { synchronized (mUsersLock) { return getProfileIdsLU(userId, null /* userType */, enabledOnly).toArray(); } } @Override public boolean isUserUnlockingOrUnlocked(@UserIdInt int userId) { int state; Loading