summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2013-05-06 13:07:05 -0700
committerSteve Kondik <shade@chemlab.org>2013-07-07 11:24:44 -0700
commit77b2f424553c29c3d1d607ef94110cf09e0d9e5b (patch)
treea94033013bfd2ab532c5c271fdd93c138c55a2ea /services
parent1fe5904deab4c799163809ad7dbf9685dedf82de (diff)
downloadframeworks_base-77b2f424553c29c3d1d607ef94110cf09e0d9e5b.zip
frameworks_base-77b2f424553c29c3d1d607ef94110cf09e0d9e5b.tar.gz
frameworks_base-77b2f424553c29c3d1d607ef94110cf09e0d9e5b.tar.bz2
Ensure install-during-restore is like install-then-restore
When we've installed an apk from the archive, recheck whether to apply the system-uid policy restrictions around file system restores. Bug 8833099 (cherry picked from commit 2baf6dcfcf7fc1705db25e64dc0cb11fa3509d39) Change-Id: I972fe1543f2234aa76baf562d6f806175ac0248e
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/BackupManagerService.java11
1 files changed, 10 insertions, 1 deletions
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 @@ class BackupManagerService extends IBackupManager.Stub {
} 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;