Add single-package restore to Bmgr feature set
Also sanity-check the package name on the Backup Manager side, failing gracefully if the given package is not a backup/restore participant. Bug: 2293977 Change-Id: I3575046ffcaa3cf45c1c602824baeadd64082f70
This commit is contained in:
@ -2427,6 +2427,12 @@ class BackupManagerService extends IBackupManager.Stub {
|
||||
throw new SecurityException("No permission to restore other packages");
|
||||
}
|
||||
|
||||
// If the package has no backup agent, we obviously cannot proceed
|
||||
if (app.applicationInfo.backupAgentName == null) {
|
||||
Log.w(TAG, "Asked to restore package " + packageName + " with no agent");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// So far so good; we're allowed to try to restore this package. Now
|
||||
// check whether there is data for it in the current dataset, falling back
|
||||
// to the ancestral dataset if not.
|
||||
|
Reference in New Issue
Block a user