Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4e4d68f authored by Christopher Tate's avatar Christopher Tate Committed by Christopher Tate
Browse files

Handle single-package restores properly

Bug 16346405

Change-Id: I69e3288f5a9d68d818fad6a2cd4b27ad45c1007e
parent 8a01b050
Loading
Loading
Loading
Loading
+48 −41
Original line number Diff line number Diff line
@@ -6409,10 +6409,16 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
            mIsSystemRestore = isFullSystemRestore;
            mFinished = false;

            if (targetPackage != null) {
                // Single package restore
                mAcceptSet = new ArrayList<PackageInfo>();
                mAcceptSet.add(targetPackage);
            } else {
                // Everything possible, or a target set
                if (filterSet == null) {
                    // We want everything and a pony
                List<PackageInfo> apps
                        = PackageManagerBackupAgent.getStorableApplications(mPackageManager);
                    List<PackageInfo> apps =
                            PackageManagerBackupAgent.getStorableApplications(mPackageManager);
                    filterSet = packagesToNames(apps);
                    if (DEBUG) {
                        Slog.i(TAG, "Full restore; asking for " + filterSet.length + " apps");
@@ -6459,6 +6465,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
                        // this one is always valid too
                    }
                }
            }

            if (MORE_DEBUG) {
                Slog.v(TAG, "Restore; accept set size is " + mAcceptSet.size());