Merge "Make "cmd package set-home-activity" more CTS friendly" into nyc-mr1-dev
This commit is contained in:
@@ -1099,8 +1099,9 @@ class PackageManagerShellCommand extends ShellCommand {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
mInterface.setHomeActivity(componentName, userId);
|
mInterface.setHomeActivity(componentName, userId);
|
||||||
|
pw.println("Success");
|
||||||
return 0;
|
return 0;
|
||||||
} catch (RemoteException e) {
|
} catch (Exception e) {
|
||||||
pw.println(e.toString());
|
pw.println(e.toString());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,8 @@ public class ShortcutManagerTestUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void setDefaultLauncher(Instrumentation instrumentation, String component) {
|
public static void setDefaultLauncher(Instrumentation instrumentation, String component) {
|
||||||
runCommandForNoOutput(instrumentation, "cmd package set-home-activity " + component);
|
runCommand(instrumentation, "cmd package set-home-activity " + component,
|
||||||
|
result -> result.contains("Success"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setDefaultLauncher(Instrumentation instrumentation, Context packageContext) {
|
public static void setDefaultLauncher(Instrumentation instrumentation, Context packageContext) {
|
||||||
@@ -202,6 +203,7 @@ public class ShortcutManagerTestUtils {
|
|||||||
if (!ENABLE_DUMPSYS) {
|
if (!ENABLE_DUMPSYS) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Log.e(TAG, "Dumpsys shortcut");
|
||||||
for (String s : runCommand(instrumentation, "dumpsys shortcut")) {
|
for (String s : runCommand(instrumentation, "dumpsys shortcut")) {
|
||||||
Log.e(TAG, s);
|
Log.e(TAG, s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user