summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-05-19 09:14:41 -0400
committerMike Lockwood <lockwood@android.com>2009-05-19 13:53:24 -0400
commitac61f6bc2b24f7ab03cdb0089c67c4034ea8549c (patch)
treef43610491a25a94d82fa7e404c20467a42bf0545 /services
parent12bb9471cb9ce2eb48d8e9817841f43e7220566f (diff)
downloadframeworks_base-ac61f6bc2b24f7ab03cdb0089c67c4034ea8549c.zip
frameworks_base-ac61f6bc2b24f7ab03cdb0089c67c4034ea8549c.tar.gz
frameworks_base-ac61f6bc2b24f7ab03cdb0089c67c4034ea8549c.tar.bz2
Telephony: Allow getCellLocation() if client has permission ACCESS_FINE_LOCATION
ACCESS_FINE_LOCATION should imply ACCESS_COARSE_LOCATION, so either of these permissions should be sufficient to allow TelephonyManager.getCellLocation(). Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/TelephonyRegistry.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/services/java/com/android/server/TelephonyRegistry.java b/services/java/com/android/server/TelephonyRegistry.java
index 22af02b..88f47fd 100644
--- a/services/java/com/android/server/TelephonyRegistry.java
+++ b/services/java/com/android/server/TelephonyRegistry.java
@@ -112,9 +112,13 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (events != 0) {
// check permissions
if ((events & PhoneStateListener.LISTEN_CELL_LOCATION) != 0) {
- mContext.enforceCallingOrSelfPermission(
- android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
-
+ // ACCESS_FINE_LOCATION implies ACCESS_COARSE_LOCATION
+ if (mContext.checkCallingPermission(
+ android.Manifest.permission.ACCESS_FINE_LOCATION)
+ != PackageManager.PERMISSION_GRANTED) {
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.ACCESS_COARSE_LOCATION, null);
+ }
}
synchronized (mRecords) {