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

Skip to content
Commit 494d4fea authored by Ng Zhi An's avatar Ng Zhi An Committed by Zhi An Ng
Browse files

Fix am start -S <package>

Previously, am start <package> and am start -S <package> had different
behaviors because the -S code path did not convert the default user id
(by calling handleIncomingUser) into a proper userId that is uses for
querying intent activities.
The default user id is converted in other code paths, so we do not
convert it inside of makeIntent, but only in the mStopOption path, right
before queryIntentActivities.

Test: adb shell am start -S com.android.chrome
Test: adb shell run-as com.example.zhin am start
(same as P)
IllegalArgumentException: No intent supplied
Test: adb shell run-as com.example.zhin am start com.example.zhin
(same as P)
Security exception: Permission Denial: startActivityAsUser asks to run as user
-2 but is calling from uid u0a193; this requires
android.permission.INTERACT_ACROSS_USERS_FULL
Test: adb shell run-as com.example.zhin am start --user 0 com.example.zhin
(same as P)
Starting: Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] pkg=com.example.zhin }
Error: Activity not started, unable to resolve Intent {
    act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]
    flg=0x10000000 pkg=com.example.zhin }
Bug: 129712542
Change-Id: I3ce6ffd40fd834bffd28b4440c1fb0024c799d95
parent 29e5ea67
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment