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

Commit daa133f8 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 udc-qpr-dev

parents bac7e944 fac6f557
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -798,18 +798,27 @@ public class CompanionDeviceManagerService extends SystemService {
        @Override
        public void enablePermissionsSync(int associationId) {
            getAssociationWithCallerChecks(associationId);
            if (getCallingUid() != SYSTEM_UID) {
                throw new SecurityException("Caller must be system UID");
            }
            mSystemDataTransferProcessor.enablePermissionsSync(associationId);
        }

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

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