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

Commit 9ac23d09 authored by Christopher Tate's avatar Christopher Tate
Browse files

Don't back up apps in the 'stopped' state

E.g. right after install from the Play Store, or after a force stop.

Bug 10845317

Change-Id: I7764ce61caa77136ca2758657f111928f9740fc0
parent e8a94224
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1992,6 +1992,15 @@ class BackupManagerService extends IBackupManager.Stub {
                    return;
                }

                if ((mCurrentPackage.applicationInfo.flags & ApplicationInfo.FLAG_STOPPED) != 0) {
                    // The app has been force-stopped or cleared or just installed,
                    // and not yet launched out of that state, so just as it won't
                    // receive broadcasts, we won't run it for backup.
                    addBackupTrace("skipping - stopped");
                    executeNextState(BackupState.RUNNING_QUEUE);
                    return;
                }

                IBackupAgent agent = null;
                try {
                    mWakelock.setWorkSource(new WorkSource(mCurrentPackage.applicationInfo.uid));