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

Commit 9f2ef5e3 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[CDM] Check for system calling UID when backing up and restoring data" into main

parents 1021eb77 692cddfb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -715,11 +715,17 @@ public class CompanionDeviceManagerService extends SystemService {

        @Override
        public byte[] getBackupPayload(int userId) {
            if (getCallingUid() != SYSTEM_UID) {
                throw new SecurityException("Caller must be system");
            }
            return mBackupRestoreProcessor.getBackupPayload(userId);
        }

        @Override
        public void applyRestoredPayload(byte[] payload, int userId) {
            if (getCallingUid() != SYSTEM_UID) {
                throw new SecurityException("Caller must be system");
            }
            mBackupRestoreProcessor.applyRestoredPayload(payload, userId);
        }