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

Commit 70a6466c authored by Brad Ebinger's avatar Brad Ebinger Committed by Android (Google) Code Review
Browse files

Merge "Allow getCallState if called from SHELL_UID" into sc-dev

parents 32930206 d9b41220
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -934,7 +934,9 @@ public class TelecomServiceImpl {
                if (CompatChanges.isChangeEnabled(
                        TelecomManager.ENABLE_GET_CALL_STATE_PERMISSION_PROTECTION, callingPackage,
                        Binder.getCallingUserHandle())) {
                    if (!canReadPhoneState(callingPackage, callingFeatureId, "getCallState")) {
                    // Bypass canReadPhoneState check if this is being called from SHELL UID
                    if (Binder.getCallingUid() != Process.SHELL_UID && !canReadPhoneState(
                            callingPackage, callingFeatureId, "getCallState")) {
                        throw new SecurityException("getCallState API requires READ_PHONE_STATE"
                                + " for API version 31+");
                    }