Merge "Sanity-check backup agent name prior to instantiation"

This commit is contained in:
Christopher Tate
2012-03-23 13:13:27 -07:00
committed by Android (Google) Code Review

View File

@@ -1986,6 +1986,16 @@ class BackupManagerService extends IBackupManager.Stub {
try {
mCurrentPackage = mPackageManager.getPackageInfo(request.packageName,
PackageManager.GET_SIGNATURES);
if (mCurrentPackage.applicationInfo.backupAgentName == null) {
// The manifest has changed but we had a stale backup request pending.
// This won't happen again because the app won't be requesting further
// backups.
Slog.i(TAG, "Package " + request.packageName
+ " no longer supports backup; skipping");
addBackupTrace("skipping - no agent, completion is noop");
executeNextState(BackupState.RUNNING_QUEUE);
return;
}
IBackupAgent agent = null;
try {