Unable to use work profile when screen lock is enabled
I found the issue while trying to set up Shelter for app isolation. When screen lock is set to `Pattern`, `PIN` or `Password`, work profile creation using Shelter or Island always fails. When screen lock remains disabled (method is set to `None` or `Swipe`), work profile can be set up and works as expected. Also, enabling screen lock while work profile is already set up causes the UI to crash repeatedly (boot animation appears). I also tried to set up work profile using `adb`: ``` adb shell pm create-user --profileOf 0 --managed Work # Replace <user_id> with id number returned by the previous command adb shell am start-user <user_id> ``` This method allowed me to go slightly further - "Work" tab appeared in the launcher app drawer. However, i was unable to launch any work app, and as soon as i tried to pause work apps and turn them back on, the UI crash occured again. More observations: - The state of "Allow multiple users" toggle in settings sems to have no effect on this. - Other types of users (like `restricted` or `guest`) can be created and seem to work with no issue, regardless of screen lock state. - The "Use one lock" toggle under "More security settings" can't be disabled. Trying to set up a screen lock for work profile always results in the following toast message being displayed: `Screen lock was already changed. Try again with the new screen lock.` Then, the toggle remains enabled. - I have tried going back to stock ROM, setting up PIN and flashing LineageOS again, as suggested [in this comment regarding somewhat similar issue](https://gitlab.com/LineageOS/issues/android/-/issues/6560#note_1892358508 'Cannot set any screen lock other than "none" and "swipe"'). Unfortunately, that did not help. ## Expected Behavior Ability to set up and use work profile with screen lock enabled. ## Current Behavior The lack of ability to use the work profile with screen lock enabled, with issues ranging from not being able to launch any work app to the entire system user interface crashing. ## Steps to Reproduce 1. In Settings, set screen locking method to "None" or "Swipe". 2. Set up a work profile using Shelter or Island or using `adb` commands listed above. 3. Set screen lock to "Pattern", "PIN" or "Password". 4. Turn off (pause) work apps (i.e. using quick settings tile or the button in the app drawer), then turn them back on. 5. Boot animation appears, and then you are back at the lockscreen. After a few seconds it happens again. ## Device information /device starlte /version lineage-20 /date 2024-05-18 /kernel Linux localhost 4.9.118-g6a9461f9460c #1 SMP PREEMPT Sun May 12 01:39:52 UTC 2024 aarch64 Toybox /baseband G960FXXUHFVB4 /mods I have read the directions.
issue