Merge "Don't check allowBackup in PackageManager"

This commit is contained in:
Ruslan Tkhakokhov
2020-09-10 08:00:57 +00:00
committed by Android (Google) Code Review

View File

@@ -14532,13 +14532,11 @@ public class PackageManagerService extends IPackageManager.Stub
Log.v(TAG, "restoreAndPostInstall userId=" + userId + " package=" + res.pkg);
}
// A restore should be performed at this point if (a) the install
// succeeded, (b) the operation is not an update, and (c) the new
// package has not opted out of backup participation.
// A restore should be requested at this point if (a) the install
// succeeded, (b) the operation is not an update.
final boolean update = res.removedInfo != null
&& res.removedInfo.removedPackage != null;
boolean allowBackup = res.pkg != null && res.pkg.isAllowBackup();
boolean doRestore = !update && allowBackup;
boolean doRestore = !update && res.pkg != null;
// Set up the post-install work request bookkeeping. This will be used
// and cleaned up by the post-install event handling regardless of whether