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

Commit 5776485a authored by Jayachandran C's avatar Jayachandran C Committed by Android Build Coastguard Worker
Browse files

Protect shell overriding the carrier config

Bug: 441823943
Flag: EXEMPT Bugfix
Test: Manually verified the scenario and all telephony and telecom CTS are verified
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:883ddab0c639c40d122d857ed6010d4c63f8ab11)
Cherrypick-From: https://googleplex-android-review.googlesource.com/q/commit:b0b2e7aa2dadf25a9244b8f43b5c134c1fecf713
Merged-In: I7662a98ad19fe37fd77ca3a3325d09a666be0ff9
Change-Id: I7662a98ad19fe37fd77ca3a3325d09a666be0ff9
parent 1c3c01a4
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -924,4 +924,13 @@ public final class TelephonyPermissions {
                || checkCallingOrSelfReadPhoneNumber(context, subId, callingPackage,
                callingFeatureId, message));
    }


    /**
     * @return true if the specified {@code uid} is for a SHELL process, no matter if runs
     * as system user or not.
     */
    public static boolean isShell(int uid) {
        return UserHandle.isSameApp(uid, Process.SHELL_UID);
    }
}