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

Commit 692cddfb authored by Raphael Kim's avatar Raphael Kim
Browse files

[CDM] Check for system calling UID when backing up and restoring data

Bug: 370962373
Test: Manual test on POC
Flag: EXEMPT bugfix
Change-Id: I307940b7194dd17eacbbfb8be5c92ac21e688c65
parent ec8b32dc
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);
        }