Merge "Add -i com.android.shell when --enable-rollback is specified." into qt-dev

am: 1c9cde6c1d

Change-Id: Ib322e8e6c6aa23988680736ce4c8a54c030f7ca4
This commit is contained in:
Richard Uhler
2019-04-17 05:41:58 -07:00
committed by android-build-merger

View File

@@ -2423,6 +2423,16 @@ class PackageManagerShellCommand extends ShellCommand {
sessionParams.setStaged();
break;
case "--enable-rollback":
if (params.installerPackageName == null) {
// com.android.shell has the TEST_MANAGE_ROLLBACKS
// permission needed to enable rollback for non-module
// packages, which is likely what the user wants when
// enabling rollback through the shell command. Set
// the installer to com.android.shell if no installer
// has been provided so that the user doesn't have to
// remember to set it themselves.
params.installerPackageName = "com.android.shell";
}
sessionParams.installFlags |= PackageManager.INSTALL_ENABLE_ROLLBACK;
break;
default: