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

Commit b1022350 authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "add missing permission check in PhoneStateListener"

am: feb7d14a

Change-Id: I7ccfab5789cd2adf654d6d593cec22f496a9a767
parents d5211044 feb7d14a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2116,6 +2116,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
        }

        if ((events & PhoneStateListener.LISTEN_RADIO_POWER_STATE_CHANGED) != 0) {
            mContext.enforceCallingOrSelfPermission(
                    android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
        }

        if ((events & PhoneStateListener.LISTEN_VOICE_ACTIVATION_STATE) != 0) {
            mContext.enforceCallingOrSelfPermission(
                    android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
        }

        return true;
    }