diff options
| author | 2025-02-20 08:49:20 -0800 | |
|---|---|---|
| committer | 2025-02-20 08:54:39 -0800 | |
| commit | 46e10f86bbeb39ac4adae8b58e98b5e8aed4d9a8 (patch) | |
| tree | 5d16e6db2f7f19b00453206d3a0ed9260914869f /libs/androidfw/StringPool.cpp | |
| parent | 7c87f8e65bb8fa7eec6d037f2d761337c507d63e (diff) | |
fix UserManagerService.enforceCurrentUserIfVisibleBackgroundEnabled
secondary_user_on_secondary_display is for background users that have
access to UI on assigned displays (a.k.a. visible background users) on
devices that have config_multiuserVisibleBackgroundUsers enabled.
The main use case is Automotive's multi-display Whole Cabin experience
where passengers (modeled as visible background users) can interact
with the display in front of them concurrently with the driver
(modeled as the the current user) interacting with driver's display.
A11yMS replaces the current user ID of A11yMS with the ID of the visible background user through the workaround code A11yMS.changeCurrentUserForTestAutomationIfNeededLocked when the visible background user is utilizing the service.
If this value is provided as an input parameter to UserManagerService.enforceCurrentUserIfVisibleBackgroundEnabled, it may lead to malfunctions, as this value does not correspond to the actual current user ID.
The structure of accepting the current user ID as an input parameter in UserManagerService.enforceCurrentUserIfVisibleBackgroundEnabled can result in such errors; therefore, it would be better to utilize ActivityManager.getCurrentUser within the function to obtain the current user ID.
Fixes include
- Removed the input parameter for UserManagerService.enforceCurrentUserIfVisibleBackgroundEnabled that accepts the current user ID.
- Ensured that UserManagerService.enforceCurrentUserIfVisibleBackgroundEnabled retrieves the current user ID using ActivityManager.getCurrentUser within its implementation
Bug: 395311248
Flag: EXEMPT bugfix
Test:
atest CtsUiAutomationTestCases
atest CtsUiAutomationTestCases --user-type secondary_user
atest CtsUiAutomationTestCases --user-type secondary_user_on_secondary_display
atest CtsAppTestCases:android.app.cts.UiModeManagerTest
atest CtsAppTestCases:android.app.cts.UiModeManagerTest --user-type secondary_user
atest CtsAppTestCases:android.app.cts.UiModeManagerTest --user-type secondary_user_on_secondary_display
atest FrameworksServicesTests:com.android.server.accessibility.AccessibilityManagerServiceTest
atest FrameworksUiServicesTests:com.android.server.UiModeManagerServiceTest
(cherry picked from https://partner-android-review.googlesource.com/q/commit:7e327fdc350126b63af06e913faabe208bb081c0)
Change-Id: Icbf357ecd348eb4bf6421334dc5263ee12ebcc66
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions