From 9ac23d0952d1d33aff0dd55a8bc78b2f77c3f602 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Thu, 19 Sep 2013 17:12:27 -0700 Subject: 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 --- services/java/com/android/server/BackupManagerService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index f3ebdb21ff93..a04ee144da29 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -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)); -- cgit v1.2.3-59-g8ed1b