Protect unbindBackupAgent() with CONFIRM_FULL_BACKUP permission

To prevent any caller that is not signed w/ the platform certificate
from calling this method.

Bug: 79700331
Test: adb shell bmgr backupnow <package>, verify agents unbound
Change-Id: I1409f015772057c84b4879dcd65bb0aaf2429803
This commit is contained in:
Bernardo Rufino
2018-06-08 08:07:30 +01:00
parent 1211216bae
commit 775fd4309f

View File

@@ -20588,6 +20588,7 @@ public class ActivityManagerService extends IActivityManager.Stub
// done with this agent
public void unbindBackupAgent(ApplicationInfo appInfo) {
if (DEBUG_BACKUP) Slog.v(TAG_BACKUP, "unbindBackupAgent: " + appInfo);
enforceCallingPermission("android.permission.CONFIRM_FULL_BACKUP", "unbindBackupAgent");
if (appInfo == null) {
Slog.w(TAG, "unbind backup agent for null app");
return;