am ac61f6bc: Telephony: Allow getCellLocation() if client has permission ACCESS_FINE_LOCATION
Merge commit 'ac61f6bc2b24f7ab03cdb0089c67c4034ea8549c' * commit 'ac61f6bc2b24f7ab03cdb0089c67c4034ea8549c': Telephony: Allow getCellLocation() if client has permission ACCESS_FINE_LOCATION
This commit is contained in:
committed by
The Android Open Source Project
commit
02436e5182
@@ -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) {
|
||||
|
||||
@@ -192,8 +192,9 @@ public class TelephonyManager {
|
||||
/**
|
||||
* Returns the current location of the device.
|
||||
*
|
||||
* <p>Requires Permission: {@link android.Manifest.permission#ACCESS_COARSE_LOCATION
|
||||
* ACCESS_COARSE_LOCATION}.
|
||||
* <p>Requires Permission:
|
||||
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_COARSE_LOCATION} or
|
||||
* {@link android.Manifest.permission#ACCESS_COARSE_LOCATION ACCESS_FINE_LOCATION}.
|
||||
*/
|
||||
public CellLocation getCellLocation() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user