diff options
| author | Rambo Wang <rambowang@google.com> | 2020-01-20 16:55:36 -0800 |
|---|---|---|
| committer | Nathan Harold <nharold@google.com> | 2020-01-29 04:29:27 +0000 |
| commit | 63ebb4b12644ac54739c2bb7dfd7685eba13857b (patch) | |
| tree | 1e6928e52ebed78c211d147521c2de0d39f341bf /core/java/android | |
| parent | b739deddc6d714e09d8644b99802491a90818260 (diff) | |
Clear up permission READ_PRIVILEGED_PHONE_STATE.
- Group all events that need the permisson together
- Enforce the permission of the group mask instead of multiple individuals
- Clear up javadoc of APIs require the permission
Bug: 148021947
Test: make offline-sdk-docs
Test: atest com.android.internal.telephony.TelephonyRegistryTest
Test: atest android.telephony.cts.PhoneStateListenerTest
Test: atest com.android.internal.telephony.PhoneStateListenerTest
Merged-In: I6c801039e3eaf22bae052de6569cf1d9a5b28396
Change-Id: I6c801039e3eaf22bae052de6569cf1d9a5b28396
(cherry picked from commit aac979e1c102c7274dac89b674b5709002d02705)
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/telephony/PhoneStateListener.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java index 03e7361159e1..1d0b4a0ca20a 100644 --- a/core/java/android/telephony/PhoneStateListener.java +++ b/core/java/android/telephony/PhoneStateListener.java @@ -225,6 +225,9 @@ public class PhoneStateListener { /** * Listen for changes to the SRVCC state of the active call. + * + * <p>Requires permission {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE} + * * @see #onServiceStateChanged(ServiceState) * @hide */ @@ -253,6 +256,9 @@ public class PhoneStateListener { /** * Listen for changes to the sim voice activation state + * + * <p>Requires permission {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE} + * * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATING * @see TelephonyManager#SIM_ACTIVATION_STATE_ACTIVATED * @see TelephonyManager#SIM_ACTIVATION_STATE_DEACTIVATED @@ -266,6 +272,7 @@ public class PhoneStateListener { * @hide */ @SystemApi + @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_VOICE_ACTIVATION_STATE = 0x00020000; /** @@ -312,10 +319,13 @@ public class PhoneStateListener { /** * Listen for changes to the radio power state. * + * <p>Requires permission {@link android.Manifest.permission#READ_PRIVILEGED_PHONE_STATE} + * * @see #onRadioPowerStateChanged * @hide */ @SystemApi + @RequiresPermission(Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int LISTEN_RADIO_POWER_STATE_CHANGED = 0x00800000; /** @@ -893,7 +903,6 @@ public class PhoneStateListener { * Callback invoked when phone capability changes. * Note, this callback triggers regardless of registered subscription. * - * Requires the READ_PRIVILEGED_PHONE_STATE permission. * @param capability the new phone capability * @hide */ @@ -923,7 +932,7 @@ public class PhoneStateListener { * subId. Otherwise, this callback applies to * {@link SubscriptionManager#getDefaultSubscriptionId()}. * - * Requires the READ_PRIVILEGED_PHONE_STATE permission. + * Requires the READ_PRECISE_PHONE_STATE permission. * @param callAttributes the call attributes * @hide */ |
