Loading services/core/java/com/android/server/pm/UserManagerInternal.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -329,6 +329,12 @@ public abstract class UserManagerInternal { */ */ public abstract void unassignUserFromDisplay(@UserIdInt int userId); public abstract void unassignUserFromDisplay(@UserIdInt int userId); /** * Returns {@code true} if the user is visible (as defined by * {@link UserManager#isUserVisible()}. */ public abstract boolean isUserVisible(@UserIdInt int userId); /** /** * Returns {@code true} if the user is visible (as defined by * Returns {@code true} if the user is visible (as defined by * {@link UserManager#isUserVisible()} in the given display. * {@link UserManager#isUserVisible()} in the given display. Loading services/core/java/com/android/server/pm/UserManagerService.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -1770,6 +1770,13 @@ public class UserManagerService extends IUserManager.Stub { // TODO(b/239982558): try to merge with isUserVisibleUnchecked() (once both are unit tested) // TODO(b/239982558): try to merge with isUserVisibleUnchecked() (once both are unit tested) boolean isUserVisibleOnDisplay(@UserIdInt int userId, int displayId) { boolean isUserVisibleOnDisplay(@UserIdInt int userId, int displayId) { // TODO(b/244644281): temporary workaround to let WM use this API without breaking current // behavior (otherwise current user / profiles wouldn't be able to launch activities on // other non-passenger displays, like cluster, display, or virtual displays) if (isCurrentUserOrRunningProfileOfCurrentUser(userId)) { return true; } if (displayId == Display.DEFAULT_DISPLAY) { if (displayId == Display.DEFAULT_DISPLAY) { return isCurrentUserOrRunningProfileOfCurrentUser(userId); return isCurrentUserOrRunningProfileOfCurrentUser(userId); } } Loading Loading @@ -6727,6 +6734,11 @@ public class UserManagerService extends IUserManager.Stub { } } } } @Override public boolean isUserVisible(int userId) { return isUserVisibleUnchecked(userId); } @Override @Override public boolean isUserVisible(int userId, int displayId) { public boolean isUserVisible(int userId, int displayId) { return isUserVisibleOnDisplay(userId, displayId); return isUserVisibleOnDisplay(userId, displayId); Loading Loading
services/core/java/com/android/server/pm/UserManagerInternal.java +6 −0 Original line number Original line Diff line number Diff line Loading @@ -329,6 +329,12 @@ public abstract class UserManagerInternal { */ */ public abstract void unassignUserFromDisplay(@UserIdInt int userId); public abstract void unassignUserFromDisplay(@UserIdInt int userId); /** * Returns {@code true} if the user is visible (as defined by * {@link UserManager#isUserVisible()}. */ public abstract boolean isUserVisible(@UserIdInt int userId); /** /** * Returns {@code true} if the user is visible (as defined by * Returns {@code true} if the user is visible (as defined by * {@link UserManager#isUserVisible()} in the given display. * {@link UserManager#isUserVisible()} in the given display. Loading
services/core/java/com/android/server/pm/UserManagerService.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -1770,6 +1770,13 @@ public class UserManagerService extends IUserManager.Stub { // TODO(b/239982558): try to merge with isUserVisibleUnchecked() (once both are unit tested) // TODO(b/239982558): try to merge with isUserVisibleUnchecked() (once both are unit tested) boolean isUserVisibleOnDisplay(@UserIdInt int userId, int displayId) { boolean isUserVisibleOnDisplay(@UserIdInt int userId, int displayId) { // TODO(b/244644281): temporary workaround to let WM use this API without breaking current // behavior (otherwise current user / profiles wouldn't be able to launch activities on // other non-passenger displays, like cluster, display, or virtual displays) if (isCurrentUserOrRunningProfileOfCurrentUser(userId)) { return true; } if (displayId == Display.DEFAULT_DISPLAY) { if (displayId == Display.DEFAULT_DISPLAY) { return isCurrentUserOrRunningProfileOfCurrentUser(userId); return isCurrentUserOrRunningProfileOfCurrentUser(userId); } } Loading Loading @@ -6727,6 +6734,11 @@ public class UserManagerService extends IUserManager.Stub { } } } } @Override public boolean isUserVisible(int userId) { return isUserVisibleUnchecked(userId); } @Override @Override public boolean isUserVisible(int userId, int displayId) { public boolean isUserVisible(int userId, int displayId) { return isUserVisibleOnDisplay(userId, displayId); return isUserVisibleOnDisplay(userId, displayId); Loading