Skip to content
Snippets Groups Projects
Commit 042ec2c1 authored by Nikita Ioffe's avatar Nikita Ioffe Committed by Gerrit Code Review
Browse files

Merge "PackageManagerShellCommand: implicitly add --wait for staged installs"

parents 2b8cb120 62d918cb
No related branches found
No related tags found
No related merge requests found
......@@ -1159,7 +1159,7 @@ class PackageManagerShellCommand extends ShellCommand {
}
abandonSession = false;
if (!params.sessionParams.isStaged || !params.waitForStagedSessionReady) {
if (!params.sessionParams.isStaged || !params.mWaitForStagedSessionReady) {
pw.println("Success");
return 0;
}
......@@ -1197,7 +1197,7 @@ class PackageManagerShellCommand extends ShellCommand {
+ si.getStagedSessionErrorMessage() + "]");
return 1;
}
pw.println("Success");
pw.println("Success. Reboot device to apply staged session");
return 0;
} finally {
if (abandonSession) {
......@@ -2487,7 +2487,7 @@ class PackageManagerShellCommand extends ShellCommand {
SessionParams sessionParams;
String installerPackageName;
int userId = UserHandle.USER_ALL;
boolean waitForStagedSessionReady = false;
boolean mWaitForStagedSessionReady = true;
long timeoutMs = DEFAULT_WAIT_MS;
}
......@@ -2615,13 +2615,16 @@ class PackageManagerShellCommand extends ShellCommand {
sessionParams.installFlags |= PackageManager.INSTALL_ENABLE_ROLLBACK;
break;
case "--wait":
params.waitForStagedSessionReady = true;
params.mWaitForStagedSessionReady = true;
try {
params.timeoutMs = Long.parseLong(peekNextArg());
getNextArg();
} catch (NumberFormatException ignore) {
}
break;
case "--no-wait":
params.mWaitForStagedSessionReady = false;
break;
default:
throw new IllegalArgumentException("Unknown option " + opt);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment