am 1b0c9c95: am 81c1d8d3: Ensure install-during-restore is like install-then-restore * commit '1b0c9c95dc72ebeb8af73bc3ff44c313ebd788f4': Ensure install-during-restore is like install-then-restore
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index 7ac314b..6044eed8 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java
@@ -3591,7 +3591,16 @@ } else { // So far so good -- do the signatures match the manifest? 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 + " signatures do not match restore manifest"); okay = false;