Skip to content

Commit 4ea283a

Browse files
Christopher TateAndroid (Google) Code Review
authored andcommitted
Merge "Sanity-check existence of restore agent" into jb-mr1-dev
2 parents be6024d + e7287a0 commit 4ea283a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4401,6 +4401,18 @@ void restoreNextAgent() {
44014401
return;
44024402
}
44034403

4404+
if (packageInfo.applicationInfo.backupAgentName == null
4405+
|| "".equals(packageInfo.applicationInfo.backupAgentName)) {
4406+
if (DEBUG) {
4407+
Slog.i(TAG, "Data exists for package " + packageName
4408+
+ " but app has no agent; skipping");
4409+
}
4410+
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName,
4411+
"Package has no agent");
4412+
executeNextState(RestoreState.RUNNING_QUEUE);
4413+
return;
4414+
}
4415+
44044416
if (metaInfo.versionCode > packageInfo.versionCode) {
44054417
// Data is from a "newer" version of the app than we have currently
44064418
// installed. If the app has not declared that it is prepared to

0 commit comments

Comments
 (0)