@@ -1434,12 +1434,9 @@ private void addPackageParticipantsLockedInner(String packageName,
14341434 set .add (pkg .packageName );
14351435 if (MORE_DEBUG ) Slog .v (TAG , "Agent found; added" );
14361436
1437- // If we've never seen this app before, schedule a backup for it
1438- if (!mEverStoredApps .contains (pkg .packageName )) {
1439- if (DEBUG ) Slog .i (TAG , "New app " + pkg .packageName
1440- + " never backed up; scheduling" );
1441- dataChangedImpl (pkg .packageName );
1442- }
1437+ // Schedule a backup for it on general principles
1438+ if (DEBUG ) Slog .i (TAG , "Scheduling backup for new app " + pkg .packageName );
1439+ dataChangedImpl (pkg .packageName );
14431440 }
14441441 }
14451442 }
@@ -1472,8 +1469,10 @@ private void removePackageFromSetLocked(final HashSet<String> set,
14721469 // Found it. Remove this one package from the bookkeeping, and
14731470 // if it's the last participating app under this uid we drop the
14741471 // (now-empty) set as well.
1472+ // Note that we deliberately leave it 'known' in the "ever backed up"
1473+ // bookkeeping so that its current-dataset data will be retrieved
1474+ // if the app is subsequently reinstalled
14751475 if (MORE_DEBUG ) Slog .v (TAG , " removing participant " + packageName );
1476- removeEverBackedUp (packageName );
14771476 set .remove (packageName );
14781477 mPendingBackups .remove (packageName );
14791478 }
@@ -5441,7 +5440,8 @@ public void restoreAtInstall(String packageName, int token) {
54415440
54425441 long restoreSet = getAvailableRestoreToken (packageName );
54435442 if (DEBUG ) Slog .v (TAG , "restoreAtInstall pkg=" + packageName
5444- + " token=" + Integer .toHexString (token ));
5443+ + " token=" + Integer .toHexString (token )
5444+ + " restoreSet=" + Long .toHexString (restoreSet ));
54455445
54465446 if (mAutoRestore && mProvisioned && restoreSet != 0 ) {
54475447 // okay, we're going to attempt a restore of this package from this restore set.
0 commit comments