diff options
| author | Hall Liu <hallliu@google.com> | 2020-06-15 23:48:19 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-06-15 23:48:19 +0000 |
| commit | 3263b53e2f68f715f618ca857b560e64c8ebaecd (patch) | |
| tree | ccf3d2c32d1a03b0e62da4eeaf9d993063110865 /core/java/android | |
| parent | 8f8af41376c1ab3e3ac05798061e9372a0752ead (diff) | |
| parent | 99115ac610c399bd80a98c8d1028d6b07d2f40e3 (diff) | |
Merge "Add more docs about location permission" into rvc-dev
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/telephony/PhoneStateListener.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java index ef21900dc3e3..4adcd6948f85 100644 --- a/core/java/android/telephony/PhoneStateListener.java +++ b/core/java/android/telephony/PhoneStateListener.java @@ -219,6 +219,9 @@ public class PhoneStateListener { /** * Listen for changes to observed cell info. * + * Listening to this event requires the {@link Manifest.permission#ACCESS_FINE_LOCATION} + * permission. + * * @see #onCellInfoChanged */ public static final int LISTEN_CELL_INFO = 0x00000400; @@ -461,6 +464,9 @@ public class PhoneStateListener { * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE} or * the calling app has carrier privileges (see {@link TelephonyManager#hasCarrierPrivileges}). * + * <p>Also requires the {@link Manifest.permission#ACCESS_FINE_LOCATION} permission, regardless + * of whether the calling app has carrier privileges. + * * @see #onRegistrationFailed */ @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) @@ -472,6 +478,9 @@ public class PhoneStateListener { * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE} or * the calling app has carrier privileges (see {@link TelephonyManager#hasCarrierPrivileges}). * + * <p>Also requires the {@link Manifest.permission#ACCESS_FINE_LOCATION} permission, regardless + * of whether the calling app has carrier privileges. + * * @see #onBarringInfoChanged */ @RequiresPermission(Manifest.permission.READ_PRECISE_PHONE_STATE) @@ -569,6 +578,11 @@ public class PhoneStateListener { * subId. Otherwise, this callback applies to * {@link SubscriptionManager#getDefaultSubscriptionId()}. * + * The instance of {@link ServiceState} passed as an argument here will have various levels of + * location information stripped from it depending on the location permissions that your app + * holds. Only apps holding the {@link Manifest.permission#ACCESS_FINE_LOCATION} permission will + * receive all the information in {@link ServiceState}. + * * @see ServiceState#STATE_EMERGENCY_ONLY * @see ServiceState#STATE_IN_SERVICE * @see ServiceState#STATE_OUT_OF_SERVICE |
