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 {
|
||||
mInterface.setHomeActivity(componentName, userId);
|
||||
pw.println("Success");
|
||||
return 0;
|
||||
} catch (RemoteException e) {
|
||||
} catch (Exception e) {
|
||||
pw.println(e.toString());
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,8 @@ public class ShortcutManagerTestUtils {
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -202,6 +203,7 @@ public class ShortcutManagerTestUtils {
|
||||
if (!ENABLE_DUMPSYS) {
|
||||
return;
|
||||
}
|
||||
Log.e(TAG, "Dumpsys shortcut");
|
||||
for (String s : runCommand(instrumentation, "dumpsys shortcut")) {
|
||||
Log.e(TAG, s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user