Skip to content

Commit 3c4da3c

Browse files
Christopher TateAndroid (Google) Code Review
authored andcommitted
Merge "Sanity-check backup agent name prior to instantiation"
2 parents b7b3894 + 9c2efb3 commit 3c4da3c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

services/java/com/android/server/BackupManagerService.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,16 @@ void invokeNextAgent() {
19861986
try {
19871987
mCurrentPackage = mPackageManager.getPackageInfo(request.packageName,
19881988
PackageManager.GET_SIGNATURES);
1989+
if (mCurrentPackage.applicationInfo.backupAgentName == null) {
1990+
// The manifest has changed but we had a stale backup request pending.
1991+
// This won't happen again because the app won't be requesting further
1992+
// backups.
1993+
Slog.i(TAG, "Package " + request.packageName
1994+
+ " no longer supports backup; skipping");
1995+
addBackupTrace("skipping - no agent, completion is noop");
1996+
executeNextState(BackupState.RUNNING_QUEUE);
1997+
return;
1998+
}
19891999

19902000
IBackupAgent agent = null;
19912001
try {

0 commit comments

Comments
 (0)