Further improvements on isUserVisibleOnDisplay(userId, displayId).
Commit d4c41e18ca3b4767907ca6ca57ce8341cdae9f25 changed this method behavior to always return true to the current user (and their profiles); that should be the case on most cases, except when the display is assigned to another user (i.e., a background user that was started on that display). This CL partially fixes that issue - it only returns true for the current / user profile when a display is not assigned to another user. It's not the ideal solution yet, because it would still fail in 2 scenarios: - It would allow the current user to be visible in a secondary display that is not being used by a passenger yet. - It would not handle the case where the a virtual display should be visible only to the user that created it. This CL also: * Changed it to always return false for INVALID_DISPLAY * Changed the is-user-visible command to allow INVALID_DISPLAY. * Fixed startUserInternal() so assignUserToDisplay() is only called after checking if the user exists. Test: atest FrameworksMockingServicesTests:com.android.server.pm.UserManagerServiceTest UserManagerInternalTest Test: adb shell am start-user --display 42 13 && \ adb shell cmd user is-user-visible --display 42 0 && adb shell cmd user is-user-visible --display -1 0 Bug: 244644281 Change-Id: I2803e0b5d49b8a729266e534bbe203e346720417
Loading
Please register or sign in to comment