Merge "Sanity-check existence of restore agent" into jb-mr1-dev

This commit is contained in:
Christopher Tate
2012-09-07 18:38:09 -07:00
committed by Android (Google) Code Review

View File

@@ -4401,6 +4401,18 @@ class BackupManagerService extends IBackupManager.Stub {
return;
}
if (packageInfo.applicationInfo.backupAgentName == null
|| "".equals(packageInfo.applicationInfo.backupAgentName)) {
if (DEBUG) {
Slog.i(TAG, "Data exists for package " + packageName
+ " but app has no agent; skipping");
}
EventLog.writeEvent(EventLogTags.RESTORE_AGENT_FAILURE, packageName,
"Package has no agent");
executeNextState(RestoreState.RUNNING_QUEUE);
return;
}
if (metaInfo.versionCode > packageInfo.versionCode) {
// Data is from a "newer" version of the app than we have currently
// installed. If the app has not declared that it is prepared to