Launch apps using current user.
Some CUJs are multi-user aware and test CUJs across multiple users.
These tests sometimes use shell commands / directy API calls to launch
an activity, but the default context and user id comes from the running
app which is the owner user id. This means that the app will launch on
the owner user regardless of the currently showing user which can cause
some tests to break since the activity seemingly never launches.
We fix this by just starting every activity with UserHandle.CURRENT.
Bug: 233015650
Test: adb shell am instrument -w -r --user 0 -e favor-shell-commands true -e class android.platform.helpers.external.multiuser.SwitchToGuestUsingLockscreenAndLaunchApp android.platform.test.scenario/androidx.test.runner.AndroidJUnitRunner
Change-Id: I6b37056f1cd443ee2b53c5caece5f7e79fa25fdf
1 file changed