Merge "Make "cmd package set-home-activity" more CTS friendly" into nyc-mr1-dev

This commit is contained in:
Makoto Onuki
2016-06-24 17:37:06 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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);
}