Merge change 3374 into donut
* changes:
Fix tracking of backup participants across package remove/update
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index 5770a77..5b70c2c 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -337,7 +337,14 @@
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); }
}