diff options
| author | 2009-06-05 13:57:54 -0700 | |
|---|---|---|
| committer | 2009-06-05 14:03:25 -0700 | |
| commit | cd4ff2e72d42d66ea2d6a27f1c87cfffd16b1791 (patch) | |
| tree | 66ded148b870e0374debd3298cf16eb014327596 | |
| parent | b1c2874790908d1bbb9b99242fc7cc96c7b45a8a (diff) | |
Fix tracking of backup participants across package remove/update
| -rw-r--r-- | services/java/com/android/server/BackupManagerService.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index 5770a771836a..5b70c2c47292 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -337,7 +337,14 @@ class BackupManagerService extends IBackupManager.Stub { int uid = app.uid; HashSet<ApplicationInfo> set = mBackupParticipants.get(uid); if (set != null) { - set.remove(app); + // Find the existing entry with the same package name, and remove it. + // We can't just remove(app) because the instances are different. + for (ApplicationInfo entry: set) { + if (entry.packageName.equals(app.packageName)) { + set.remove(entry); + break; + } + } if (set.size() == 0) { mBackupParticipants.delete(uid); } } |