Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f07f1e54 authored by Brahim Chikhaoui's avatar Brahim Chikhaoui
Browse files

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
parent 49dbd164
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment