diff options
| author | 2023-03-07 14:53:17 -0800 | |
|---|---|---|
| committer | 2023-03-08 12:50:14 -0800 | |
| commit | ecdc6fb6a3d8ec49c5ccde64e6a17463e35c2de9 (patch) | |
| tree | c0b0c123072550e749dbcba3b29eabd6c1f18d5b /libs/androidfw/StringPool.cpp | |
| parent | 3fd4802dad7416a6f31bef9e5922b5753385ce13 (diff) | |
Fixed (again :-( `am start-user` for profiles.
Previously it was requiring the caller to explicitly pass
--force-invisible to start a profile invisible when its parent is not
the current user, but that would break existing CTS tests.
Here's an example on how to reproduce the issue:
$ adb shell pm create-user --profileOf 0 --user-type android.os.usertype.profile.CLONE DollyTheSheep
Success: created user id 12
$ adb shell pm create-user Homer
Success: created user id 13
$ adb shell am switch-user 13
$ adb shell cmd user list --all -v
3 users:
0: id=0, name=Owner, type=full.SYSTEM, flags=ADMIN|FULL|INITIALIZED|MAIN|PRIMARY|SYSTEM (running)
1: id=12, name=DollyTheSheep, type=profile.CLONE, flags=PROFILE (parentId=0)
2: id=13, name=Homer, type=full.SECONDARY, flags=FULL|INITIALIZED (running) (current) (visible)
$ adb shell am start-user 12
Error: could not start user
03-07 22:56:32.621 22936 28819 W UserVisibilityMediator: getUserVisibilityOnStartLocked(12, 0, BACKGROUND_VISIBLE, 0) failed: cannot start profile user visible when its parent is not visible in that display
$ adb shell cmd user is-user-visible 12
false
And how it's working now:
$ adb shell am get-current-user
13
$ adb shell am start-user 12
Success: user started
$ adb shell cmd user is-user-visible 12
false
$ adb shell cmd user list --all -v
3 users:
0: id=0, name=Owner, type=full.SYSTEM, flags=ADMIN|FULL|INITIALIZED|MAIN|PRIMARY|SYSTEM (running)
1: id=12, name=DollyTheSheep, type=profile.CLONE, flags=INITIALIZED|PROFILE (parentId=0) (running)
2: id=13, name=Homer, type=full.SECONDARY, flags=FULL|INITIALIZED (running) (current) (visible)
Test: see above
Fixes: 272089437
Change-Id: Ib9cc2d3bf4092bf7899a7b7e9d9bb4bf904c5a4a
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions