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

Commit 6a9297de authored by Guojing Yuan's avatar Guojing Yuan Committed by Android (Google) Code Review
Browse files

Merge "[CDM] Check if it's system UID for hidden Perm Sync APIs" into main

parents e38ff355 7e5e4761
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -628,16 +628,25 @@ public class CompanionDeviceManagerService extends SystemService {

        @Override
        public void enablePermissionsSync(int associationId) {
            if (getCallingUid() != SYSTEM_UID) {
                throw new SecurityException("Caller must be system UID");
            }
            mSystemDataTransferProcessor.enablePermissionsSync(associationId);
        }

        @Override
        public void disablePermissionsSync(int associationId) {
            if (getCallingUid() != SYSTEM_UID) {
                throw new SecurityException("Caller must be system UID");
            }
            mSystemDataTransferProcessor.disablePermissionsSync(associationId);
        }

        @Override
        public PermissionSyncRequest getPermissionSyncRequest(int associationId) {
            if (getCallingUid() != SYSTEM_UID) {
                throw new SecurityException("Caller must be system UID");
            }
            return mSystemDataTransferProcessor.getPermissionSyncRequest(associationId);
        }