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

Commit 52797b6a authored by chen xu's avatar chen xu
Browse files

add missing permission check in PhoneStateListener

Bug: 122612337
Test: cts
Change-Id: I85e3d4ce1dd4473eb43ece801c24a0e79362a18b
parent 8df9d172
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2116,6 +2116,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
                    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;
        return true;
    }
    }