Prevent switching to non-full users with supportsSwitchToByUser
On Android Desktop with Headless System User Mode (HSUM), regular users should not be able to switch to the system user via the UI. The `config_canSwitchToHeadlessSystemUser` allowed this at the framework level,via supportsSwitchTo but the UI should prevent such switches. This change un-deprecates `supportsSwitchToByUser` and modifies it to ensure that only full users (`UserInfo::isFull`) are considered switchable through this method. This explicitly prevents switching to the headless system user from the UI, as such operations are intended to be framework-level and should rely on `supportsSwitchTo`. The updated `supportsSwitchToByUser` method now returns true if `supportsSwitchTo()` is true AND the target user is a full user. This ensures that the headless system user, which is not a full user, is not presented as a switchable option to end users in Settings. Bug: 393051605 Test: manually build and deploy in DUT Flag: EXEMPT desktop only Change-Id: I8a07d32eb7eb88bb28987cb8dabf8a244150acde
Loading
Please register or sign in to comment