Loading core/java/android/app/ActivityManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -4434,7 +4434,8 @@ public class ActivityManager { "device does not support users on secondary displays"); } try { return getService().startUserInBackgroundVisibleOnDisplay(userId, displayId); return getService().startUserInBackgroundVisibleOnDisplay(userId, displayId, /* unlockProgressListener= */ null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/app/IActivityManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -805,7 +805,7 @@ interface IActivityManager { */ @JavaPassthrough(annotation= "@android.annotation.RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}, conditional = true)") boolean startUserInBackgroundVisibleOnDisplay(int userid, int displayId); boolean startUserInBackgroundVisibleOnDisplay(int userid, int displayId, IProgressListener unlockProgressListener); /** * Similar to {@link #startProfile(int userId)}, but with a listener to report user unlock Loading services/core/java/com/android/server/am/ActivityManagerService.java +9 −6 Original line number Diff line number Diff line Loading @@ -16713,7 +16713,8 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId) { public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId, @Nullable IProgressListener unlockListener) { int[] displayIds = getDisplayIdsForStartingVisibleBackgroundUsers(); boolean validDisplay = false; if (displayIds != null) { Loading @@ -16730,11 +16731,11 @@ public class ActivityManagerService extends IActivityManager.Stub } if (DEBUG_MU) { Slogf.d(TAG_MU, "Calling startUserOnSecondaryDisplay(%d, %d) using injector %s", userId, displayId, mInjector); Slogf.d(TAG_MU, "Calling startUserOnSecondaryDisplay(%d, %d, %s) using injector %s", userId, displayId, unlockListener, mInjector); } // Permission check done inside UserController. return mInjector.startUserInBackgroundVisibleOnDisplay(userId, displayId); return mInjector.startUserInBackgroundVisibleOnDisplay(userId, displayId, unlockListener); } @Override Loading Loading @@ -19115,8 +19116,10 @@ public class ActivityManagerService extends IActivityManager.Stub /** * Called by {@code AMS.startUserInBackgroundVisibleOnDisplay()}. */ public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId) { return mUserController.startUserVisibleOnDisplay(userId, displayId); public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId, @Nullable IProgressListener unlockProgressListener) { return mUserController.startUserVisibleOnDisplay(userId, displayId, unlockProgressListener); } /** services/core/java/com/android/server/am/ActivityManagerShellCommand.java +5 −3 Original line number Diff line number Diff line Loading @@ -2261,9 +2261,10 @@ final class ActivityManagerShellCommand extends ShellCommand { pw.println("Not supported"); return -1; } Slogf.d(TAG, "calling startUserInBackgroundVisibleOnDisplay(%d,%d)", userId, displayId); success = mInterface.startUserInBackgroundVisibleOnDisplay(userId, displayId); Slogf.d(TAG, "calling startUserInBackgroundVisibleOnDisplay(%d, %d, %s)", userId, displayId, waiter); success = mInterface.startUserInBackgroundVisibleOnDisplay(userId, displayId, waiter); displaySuffix = " on display " + displayId; } if (wait && success) { Loading Loading @@ -3867,6 +3868,7 @@ final class ActivityManagerShellCommand extends ShellCommand { int runListDisplaysForStartingUsers(PrintWriter pw) throws RemoteException { int[] displayIds = mInterface.getDisplayIdsForStartingVisibleBackgroundUsers(); // NOTE: format below cannot be changed as it's used by ITestDevice pw.println(displayIds == null || displayIds.length == 0 ? "none" : Arrays.toString(displayIds)); Loading services/core/java/com/android/server/am/UserController.java +4 −2 Original line number Diff line number Diff line Loading @@ -1560,16 +1560,18 @@ class UserController implements Handler.Callback { * * @param userId user to be started * @param displayId display where the user will be visible * @param unlockListener Listener to be informed when the user has started and unlocked. * * @return whether the user was started */ boolean startUserVisibleOnDisplay(@UserIdInt int userId, int displayId) { boolean startUserVisibleOnDisplay(@UserIdInt int userId, int displayId, @Nullable IProgressListener unlockListener) { checkCallingHasOneOfThosePermissions("startUserOnDisplay", MANAGE_USERS, INTERACT_ACROSS_USERS); try { return startUserNoChecks(userId, displayId, USER_START_MODE_BACKGROUND_VISIBLE, /* unlockListener= */ null); unlockListener); } catch (RuntimeException e) { Slogf.e(TAG, "startUserOnSecondaryDisplay(%d, %d) failed: %s", userId, displayId, e); return false; Loading Loading
core/java/android/app/ActivityManager.java +2 −1 Original line number Diff line number Diff line Loading @@ -4434,7 +4434,8 @@ public class ActivityManager { "device does not support users on secondary displays"); } try { return getService().startUserInBackgroundVisibleOnDisplay(userId, displayId); return getService().startUserInBackgroundVisibleOnDisplay(userId, displayId, /* unlockProgressListener= */ null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/app/IActivityManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -805,7 +805,7 @@ interface IActivityManager { */ @JavaPassthrough(annotation= "@android.annotation.RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}, conditional = true)") boolean startUserInBackgroundVisibleOnDisplay(int userid, int displayId); boolean startUserInBackgroundVisibleOnDisplay(int userid, int displayId, IProgressListener unlockProgressListener); /** * Similar to {@link #startProfile(int userId)}, but with a listener to report user unlock Loading
services/core/java/com/android/server/am/ActivityManagerService.java +9 −6 Original line number Diff line number Diff line Loading @@ -16713,7 +16713,8 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId) { public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId, @Nullable IProgressListener unlockListener) { int[] displayIds = getDisplayIdsForStartingVisibleBackgroundUsers(); boolean validDisplay = false; if (displayIds != null) { Loading @@ -16730,11 +16731,11 @@ public class ActivityManagerService extends IActivityManager.Stub } if (DEBUG_MU) { Slogf.d(TAG_MU, "Calling startUserOnSecondaryDisplay(%d, %d) using injector %s", userId, displayId, mInjector); Slogf.d(TAG_MU, "Calling startUserOnSecondaryDisplay(%d, %d, %s) using injector %s", userId, displayId, unlockListener, mInjector); } // Permission check done inside UserController. return mInjector.startUserInBackgroundVisibleOnDisplay(userId, displayId); return mInjector.startUserInBackgroundVisibleOnDisplay(userId, displayId, unlockListener); } @Override Loading Loading @@ -19115,8 +19116,10 @@ public class ActivityManagerService extends IActivityManager.Stub /** * Called by {@code AMS.startUserInBackgroundVisibleOnDisplay()}. */ public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId) { return mUserController.startUserVisibleOnDisplay(userId, displayId); public boolean startUserInBackgroundVisibleOnDisplay(int userId, int displayId, @Nullable IProgressListener unlockProgressListener) { return mUserController.startUserVisibleOnDisplay(userId, displayId, unlockProgressListener); } /**
services/core/java/com/android/server/am/ActivityManagerShellCommand.java +5 −3 Original line number Diff line number Diff line Loading @@ -2261,9 +2261,10 @@ final class ActivityManagerShellCommand extends ShellCommand { pw.println("Not supported"); return -1; } Slogf.d(TAG, "calling startUserInBackgroundVisibleOnDisplay(%d,%d)", userId, displayId); success = mInterface.startUserInBackgroundVisibleOnDisplay(userId, displayId); Slogf.d(TAG, "calling startUserInBackgroundVisibleOnDisplay(%d, %d, %s)", userId, displayId, waiter); success = mInterface.startUserInBackgroundVisibleOnDisplay(userId, displayId, waiter); displaySuffix = " on display " + displayId; } if (wait && success) { Loading Loading @@ -3867,6 +3868,7 @@ final class ActivityManagerShellCommand extends ShellCommand { int runListDisplaysForStartingUsers(PrintWriter pw) throws RemoteException { int[] displayIds = mInterface.getDisplayIdsForStartingVisibleBackgroundUsers(); // NOTE: format below cannot be changed as it's used by ITestDevice pw.println(displayIds == null || displayIds.length == 0 ? "none" : Arrays.toString(displayIds)); Loading
services/core/java/com/android/server/am/UserController.java +4 −2 Original line number Diff line number Diff line Loading @@ -1560,16 +1560,18 @@ class UserController implements Handler.Callback { * * @param userId user to be started * @param displayId display where the user will be visible * @param unlockListener Listener to be informed when the user has started and unlocked. * * @return whether the user was started */ boolean startUserVisibleOnDisplay(@UserIdInt int userId, int displayId) { boolean startUserVisibleOnDisplay(@UserIdInt int userId, int displayId, @Nullable IProgressListener unlockListener) { checkCallingHasOneOfThosePermissions("startUserOnDisplay", MANAGE_USERS, INTERACT_ACROSS_USERS); try { return startUserNoChecks(userId, displayId, USER_START_MODE_BACKGROUND_VISIBLE, /* unlockListener= */ null); unlockListener); } catch (RuntimeException e) { Slogf.e(TAG, "startUserOnSecondaryDisplay(%d, %d) failed: %s", userId, displayId, e); return false; Loading