summaryrefslogtreecommitdiff
path: root/libs/androidfw/Util.cpp
diff options
context:
space:
mode:
author Felipe Leme <felipeal@google.com> 2022-09-02 09:14:06 -0700
committer Felipe Leme <felipeal@google.com> 2022-09-12 11:23:29 -0700
commit5a82b5aeb9996cc1284722f81d338a571c6e6dec (patch)
tree1c98925306899b03c295340ad7b2387ff9891d3d /libs/androidfw/Util.cpp
parentc1527fea2afe01ab6a21cc46730e610d146aa5dd (diff)
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
Diffstat (limited to 'libs/androidfw/Util.cpp')
0 files changed, 0 insertions, 0 deletions