Merge "Ensure install-during-restore is like install-then-restore" into jb-mr2-dev

This commit is contained in:
Christopher Tate
2013-05-06 21:12:40 +00:00
committed by Android (Google) Code Review

View File

@@ -3735,7 +3735,16 @@ class BackupManagerService extends IBackupManager.Stub {
} else { } else {
// So far so good -- do the signatures match the manifest? // So far so good -- do the signatures match the manifest?
Signature[] sigs = mManifestSignatures.get(info.packageName); Signature[] sigs = mManifestSignatures.get(info.packageName);
if (!signaturesMatch(sigs, pkg)) { if (signaturesMatch(sigs, pkg)) {
// If this is a system-uid app without a declared backup agent,
// don't restore any of the file data.
if ((pkg.applicationInfo.uid < Process.FIRST_APPLICATION_UID)
&& (pkg.applicationInfo.backupAgentName == null)) {
Slog.w(TAG, "Installed app " + info.packageName
+ " has restricted uid and no agent");
okay = false;
}
} else {
Slog.w(TAG, "Installed app " + info.packageName Slog.w(TAG, "Installed app " + info.packageName
+ " signatures do not match restore manifest"); + " signatures do not match restore manifest");
okay = false; okay = false;