Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 775fd430 authored by Bernardo Rufino's avatar Bernardo Rufino
Browse files

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
parent 1211216b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;