diff options
| author | 2020-01-21 23:16:42 +0000 | |
|---|---|---|
| committer | 2020-01-21 23:16:42 +0000 | |
| commit | 042ec2c190eb610bed6fabfa7447bd65d0f4f349 (patch) | |
| tree | 7340ecc78bf08c9f6a3207a245af8abf3397aa64 | |
| parent | 2b8cb120045889cb409cbfa882d3348e052ccc3f (diff) | |
| parent | 62d918cbc0c6f3bd911f01e9607f11e7dfbb219e (diff) | |
Merge "PackageManagerShellCommand: implicitly add --wait for staged installs"
| -rw-r--r-- | services/core/java/com/android/server/pm/PackageManagerShellCommand.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java index e991a91fe8ba..609a41560e7b 100644 --- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java +++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java @@ -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); } |