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

Commit 2ae33e49 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:61e268908be18329edacfc6c5d54b92d39033de2
Merged-In: I7662a98ad19fe37fd77ca3a3325d09a666be0ff9
Change-Id: I7662a98ad19fe37fd77ca3a3325d09a666be0ff9
parent 03d70406
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -923,4 +923,13 @@ public final class TelephonyPermissions {
        return UserHandle.isSameApp(uid, Process.ROOT_UID) || UserHandle.isSameApp(uid,
                Process.SHELL_UID);
    }


    /**
     * @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);
    }
}