summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorZoey Chen <zoeychen@google.com>2021-05-27 20:16:35 +0800
committerZoey Chen <zoeychen@google.com>2021-06-29 16:11:13 +0800
commit6d33beea884dca811857aff7262f20d19c87aa68 (patch)
tree4ed8544bd093161cb4d6f05dc4e7fa5cc5235330 /core/java
parenta38c45addea115c215df029b89214d63c9e8737d (diff)
[Telephony] Add description about location permission
- Hold ACCESS_FINE_LOCATION: full service state - Hold ACCESS_COARSE_LOCATION: set cellIdentity is null - No local permission: set cellIdentity, mOperatorAlphaLong, mOperatorAlphaShort and mOperatorNumeric are null Bug: 165014401 Test: make Change-Id: I9ada08a530d9b8bc8483edfad783ff3b7434faa3
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/telephony/PhoneStateListener.java6
-rw-r--r--core/java/android/telephony/TelephonyCallback.java7
2 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/telephony/PhoneStateListener.java b/core/java/android/telephony/PhoneStateListener.java
index a1ffe345d457..d39b56ddabed 100644
--- a/core/java/android/telephony/PhoneStateListener.java
+++ b/core/java/android/telephony/PhoneStateListener.java
@@ -621,7 +621,11 @@ public class PhoneStateListener {
* 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}.
+ * receive all the information in {@link ServiceState}, otherwise the cellIdentity will be null
+ * if apps only holding the {@link Manifest.permission#ACCESS_COARSE_LOCATION} permission.
+ * Network operator name in long/short alphanumeric format and numeric id will be null if apps
+ * holding neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor
+ * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}.
*
* @see ServiceState#STATE_EMERGENCY_ONLY
* @see ServiceState#STATE_IN_SERVICE
diff --git a/core/java/android/telephony/TelephonyCallback.java b/core/java/android/telephony/TelephonyCallback.java
index 1a25c8b4e671..dd4de0a81392 100644
--- a/core/java/android/telephony/TelephonyCallback.java
+++ b/core/java/android/telephony/TelephonyCallback.java
@@ -663,7 +663,12 @@ public class TelephonyCallback {
* 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}.
+ * receive all the information in {@link ServiceState}, otherwise the cellIdentity
+ * will be null if apps only holding the {@link Manifest.permission#ACCESS_COARSE_LOCATION}
+ * permission.
+ * Network operator name in long/short alphanumeric format and numeric id will be null if
+ * apps holding neither {@link android.Manifest.permission#ACCESS_FINE_LOCATION} nor
+ * {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}.
*
* @see ServiceState#STATE_EMERGENCY_ONLY
* @see ServiceState#STATE_IN_SERVICE