Fix CtsShortcutHostTestCases#testSecondaryUser
This patch uses Instrumentation parameter inside getDefaultLauncher function to obtain user ID from it and get default launcher namely for that user as setDefaultLauncher function sets launcher for the user from Instrumentation context. This fixes incorrect launcher settings for the cases that use two sequential calls to get/set default launcher. Bug: 145774461 Test: run cts -m CtsShortcutHostTestCases -t \ android.content.pm.cts.shortcuthost.ShortcutManagerMultiuserTest#testSecondaryUser Signed-off-by: Sergii Iegorov <sergii.iegorov@globallogic.com> Change-Id: I8941f5648ad783c7681fdb56677e855756db957d
This commit is contained in:
@@ -197,7 +197,8 @@ public class ShortcutManagerTestUtils {
|
||||
final String PREFIX = "Launcher: ComponentInfo{";
|
||||
final String POSTFIX = "}";
|
||||
final List<String> result = runShortcutCommandForSuccess(
|
||||
instrumentation, "get-default-launcher");
|
||||
instrumentation, "get-default-launcher --user "
|
||||
+ instrumentation.getContext().getUserId());
|
||||
for (String s : result) {
|
||||
if (s.startsWith(PREFIX) && s.endsWith(POSTFIX)) {
|
||||
return s.substring(PREFIX.length(), s.length() - POSTFIX.length());
|
||||
|
||||
Reference in New Issue
Block a user