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

Commit 73d120dd authored by rambowang's avatar rambowang
Browse files

Check system and phone UID in multiple-user-aware way

This CL calls TelephonyPermissions.isSystemOrPhone to make sure the UID check with Process.SYSTEM_UID and PHONE_UID are multiple-user-aware.

The logic to directly compare UID with PROCESS.XXX_UID only works for system user. For secondary users, system/phone processes run with UID prefixed with user id.

UserHandle.isSameApp helps to correctly detect the system/phone process by comparing only the App id part.

Bug: 328511085
Test: atest TelephonyProviderTests
Flag: com.android.internal.telephony.flags.support_phone_uid_check_for_multiuser
Change-Id: Id845f2d0076311e5a6b6fe7bae720889d9e12873
parent 5460f4c5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2989,7 +2989,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        // Always redact location info from PhysicalChannelConfig if the registrant is from neither
        // PHONE nor SYSTEM process. There is no user case that the registrant needs the location
        // info (e.g. physicalCellId). This also remove the need for the location permissions check.
        return record.callerUid != Process.PHONE_UID && record.callerUid != Process.SYSTEM_UID;
        return !TelephonyPermissions.isSystemOrPhone(record.callerUid);
    }

    /**