Loading services/core/java/com/android/server/am/AppErrors.java +2 −22 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import com.android.internal.logging.nano.MetricsProto; import com.android.server.LocalServices; import com.android.server.PackageWatchdog; import com.android.server.pm.UserManagerInternal; import com.android.server.pm.UserManagerService; import com.android.server.usage.AppStandbyInternal; import com.android.server.wm.WindowProcessController; Loading Loading @@ -1027,7 +1026,8 @@ class AppErrors { isBackground &= (userId != profileId); } int visibleUserId = getVisibleUserId(userId); boolean isVisibleUser = isVisibleBackgroundUser(visibleUserId); boolean isVisibleUser = LocalServices.getService(UserManagerInternal.class) .isVisibleBackgroundFullUser(visibleUserId); boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0, visibleUserId) != 0; if (isBackground && !showBackground && !isVisibleUser) { Loading Loading @@ -1182,26 +1182,6 @@ class AppErrors { return appUserId; } /** * Checks if the given user is a visible background user, which is a full, background user * assigned to secondary displays on the devices that have * {@link UserManager#isVisibleBackgroundUsersEnabled() * config_multiuserVisibleBackgroundUsers enabled} (for example, passenger users on * automotive builds, using the display associated with their seats). * * @see UserManager#isUserVisible() */ private boolean isVisibleBackgroundUser(int userId) { if (!UserManager.isVisibleBackgroundUsersEnabled()) { return false; } boolean isForeground = mService.mUserController.getCurrentUserId() == userId; boolean isProfile = UserManagerService.getInstance().isProfile(userId); boolean isVisible = LocalServices.getService(UserManagerInternal.class) .isUserVisible(userId); return isVisible && !isForeground && !isProfile; } /** * Information about a process that is currently marked as bad. */ Loading services/core/java/com/android/server/pm/UserManagerInternal.java +11 −0 Original line number Diff line number Diff line Loading @@ -496,6 +496,17 @@ public abstract class UserManagerInternal { */ public abstract boolean isUserVisible(@UserIdInt int userId, int displayId); /** * Checks if the given user is a visible background full user, which is a full background user * assigned to secondary displays on the devices that have * {@link UserManager#isVisibleBackgroundUsersEnabled() * config_multiuserVisibleBackgroundUsers enabled} (for example, passenger users on * automotive builds, using the display associated with their seats). * * @see UserManager#isUserVisible() */ public abstract boolean isVisibleBackgroundFullUser(@UserIdInt int userId); /** * Returns the main display id assigned to the user, or {@code Display.INVALID_DISPLAY} if the * user is not assigned to any main display. Loading services/core/java/com/android/server/pm/UserManagerService.java +11 −0 Original line number Diff line number Diff line Loading @@ -7926,6 +7926,17 @@ public class UserManagerService extends IUserManager.Stub { return mUserVisibilityMediator.isUserVisible(userId, displayId); } @Override public boolean isVisibleBackgroundFullUser(@UserIdInt int userId) { if (!UserManager.isVisibleBackgroundUsersEnabled()) { return false; } boolean isForeground = userId == getCurrentUserId(); boolean isProfile = isProfileUnchecked(userId); boolean isVisible = isUserVisible(userId); return isVisible && !isForeground && !isProfile; } @Override public int getMainDisplayAssignedToUser(@UserIdInt int userId) { return mUserVisibilityMediator.getMainDisplayAssignedToUser(userId); Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −20 Original line number Diff line number Diff line Loading @@ -7174,25 +7174,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } /** * Checks if the given user is a visible background user, which is a full, background user * assigned to secondary displays on the devices that have * {@link UserManager#isVisibleBackgroundUsersEnabled() * config_multiuserVisibleBackgroundUsers enabled} (for example, passenger users on * automotive builds, using the display associated with their seats). * * @see UserManager#isUserVisible() */ private boolean isVisibleBackgroundUser(int userId) { if (!UserManager.isVisibleBackgroundUsersEnabled()) { return false; } boolean isForeground = getCurrentUserId() == userId; boolean isProfile = getUserManager().isProfile(userId); boolean isVisible = mWindowManager.mUmInternal.isUserVisible(userId); return isVisible && !isForeground && !isProfile; } /** * In a car environment, {@link ActivityTaskManagerService#mShowDialogs} is always set to * {@code false} from {@link ActivityTaskManagerService#updateShouldShowDialogsLocked} Loading @@ -7208,7 +7189,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { * @see ActivityTaskManagerService#updateShouldShowDialogsLocked */ private boolean shouldShowDialogsForVisibleBackgroundUserLocked(int userId) { if (!isVisibleBackgroundUser(userId)) { if (!mWindowManager.mUmInternal.isVisibleBackgroundFullUser(userId)) { return false; } final int displayId = mWindowManager.mUmInternal.getMainDisplayAssignedToUser(userId); Loading Loading
services/core/java/com/android/server/am/AppErrors.java +2 −22 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ import com.android.internal.logging.nano.MetricsProto; import com.android.server.LocalServices; import com.android.server.PackageWatchdog; import com.android.server.pm.UserManagerInternal; import com.android.server.pm.UserManagerService; import com.android.server.usage.AppStandbyInternal; import com.android.server.wm.WindowProcessController; Loading Loading @@ -1027,7 +1026,8 @@ class AppErrors { isBackground &= (userId != profileId); } int visibleUserId = getVisibleUserId(userId); boolean isVisibleUser = isVisibleBackgroundUser(visibleUserId); boolean isVisibleUser = LocalServices.getService(UserManagerInternal.class) .isVisibleBackgroundFullUser(visibleUserId); boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0, visibleUserId) != 0; if (isBackground && !showBackground && !isVisibleUser) { Loading Loading @@ -1182,26 +1182,6 @@ class AppErrors { return appUserId; } /** * Checks if the given user is a visible background user, which is a full, background user * assigned to secondary displays on the devices that have * {@link UserManager#isVisibleBackgroundUsersEnabled() * config_multiuserVisibleBackgroundUsers enabled} (for example, passenger users on * automotive builds, using the display associated with their seats). * * @see UserManager#isUserVisible() */ private boolean isVisibleBackgroundUser(int userId) { if (!UserManager.isVisibleBackgroundUsersEnabled()) { return false; } boolean isForeground = mService.mUserController.getCurrentUserId() == userId; boolean isProfile = UserManagerService.getInstance().isProfile(userId); boolean isVisible = LocalServices.getService(UserManagerInternal.class) .isUserVisible(userId); return isVisible && !isForeground && !isProfile; } /** * Information about a process that is currently marked as bad. */ Loading
services/core/java/com/android/server/pm/UserManagerInternal.java +11 −0 Original line number Diff line number Diff line Loading @@ -496,6 +496,17 @@ public abstract class UserManagerInternal { */ public abstract boolean isUserVisible(@UserIdInt int userId, int displayId); /** * Checks if the given user is a visible background full user, which is a full background user * assigned to secondary displays on the devices that have * {@link UserManager#isVisibleBackgroundUsersEnabled() * config_multiuserVisibleBackgroundUsers enabled} (for example, passenger users on * automotive builds, using the display associated with their seats). * * @see UserManager#isUserVisible() */ public abstract boolean isVisibleBackgroundFullUser(@UserIdInt int userId); /** * Returns the main display id assigned to the user, or {@code Display.INVALID_DISPLAY} if the * user is not assigned to any main display. Loading
services/core/java/com/android/server/pm/UserManagerService.java +11 −0 Original line number Diff line number Diff line Loading @@ -7926,6 +7926,17 @@ public class UserManagerService extends IUserManager.Stub { return mUserVisibilityMediator.isUserVisible(userId, displayId); } @Override public boolean isVisibleBackgroundFullUser(@UserIdInt int userId) { if (!UserManager.isVisibleBackgroundUsersEnabled()) { return false; } boolean isForeground = userId == getCurrentUserId(); boolean isProfile = isProfileUnchecked(userId); boolean isVisible = isUserVisible(userId); return isVisible && !isForeground && !isProfile; } @Override public int getMainDisplayAssignedToUser(@UserIdInt int userId) { return mUserVisibilityMediator.getMainDisplayAssignedToUser(userId); Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −20 Original line number Diff line number Diff line Loading @@ -7174,25 +7174,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } /** * Checks if the given user is a visible background user, which is a full, background user * assigned to secondary displays on the devices that have * {@link UserManager#isVisibleBackgroundUsersEnabled() * config_multiuserVisibleBackgroundUsers enabled} (for example, passenger users on * automotive builds, using the display associated with their seats). * * @see UserManager#isUserVisible() */ private boolean isVisibleBackgroundUser(int userId) { if (!UserManager.isVisibleBackgroundUsersEnabled()) { return false; } boolean isForeground = getCurrentUserId() == userId; boolean isProfile = getUserManager().isProfile(userId); boolean isVisible = mWindowManager.mUmInternal.isUserVisible(userId); return isVisible && !isForeground && !isProfile; } /** * In a car environment, {@link ActivityTaskManagerService#mShowDialogs} is always set to * {@code false} from {@link ActivityTaskManagerService#updateShouldShowDialogsLocked} Loading @@ -7208,7 +7189,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { * @see ActivityTaskManagerService#updateShouldShowDialogsLocked */ private boolean shouldShowDialogsForVisibleBackgroundUserLocked(int userId) { if (!isVisibleBackgroundUser(userId)) { if (!mWindowManager.mUmInternal.isVisibleBackgroundFullUser(userId)) { return false; } final int displayId = mWindowManager.mUmInternal.getMainDisplayAssignedToUser(userId); Loading