summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Coucheron <arco68@gmail.com>2018-05-18 05:10:12 +0200
committerArne Coucheron <arco68@gmail.com>2018-05-18 05:36:39 +0200
commit06b3638335e1e4cfb2afe7b5393c9253bed1d638 (patch)
tree0b76a53951e051874e6a5ed2127c4927957ff415
parent176b9829685146d98f135dc3535a4a08ec83c573 (diff)
downloadandroid_packages_apps_Snap-06b3638335e1e4cfb2afe7b5393c9253bed1d638.zip
android_packages_apps_Snap-06b3638335e1e4cfb2afe7b5393c9253bed1d638.tar.gz
android_packages_apps_Snap-06b3638335e1e4cfb2afe7b5393c9253bed1d638.tar.bz2
Snap: Check for ACCESS_FINE_LOCATION instead of ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION is now required for GPS location feature to work. | LocationManager: java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission. Change-Id: I6b2f11bdab719cb9fc74a67a8e91ad558269d579
-rw-r--r--src/com/android/camera/CameraActivity.java10
-rwxr-xr-xsrc/com/android/camera/LocationManager.java2
-rwxr-xr-xsrc/com/android/camera/PermissionsActivity.java4
-rw-r--r--src/com/android/camera/PhotoModule.java2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index b48a232..29a5cdb 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -171,7 +171,7 @@ public class CameraActivity extends Activity
private static final int SWITCH_SAVE_PATH = 2;
/** Permission request code */
- private static final int PERMISSIONS_REQUEST_ACCESS_COARSE_LOCATION = 1;
+ private static final int PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION = 1;
/** Whether onResume should reset the view to the preview. */
private boolean mResetToPreviewOnResume = true;
@@ -2103,13 +2103,13 @@ public class CameraActivity extends Activity
}
public void requestLocationPermission() {
- if (checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
+ if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
Log.v(TAG, "Request Location permission");
mCurrentModule.waitingLocationPermissionResult(true);
requestPermissions(
- new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
- PERMISSIONS_REQUEST_ACCESS_COARSE_LOCATION);
+ new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
+ PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);
}
}
@@ -2117,7 +2117,7 @@ public class CameraActivity extends Activity
public void onRequestPermissionsResult(int requestCode,
String permissions[], int[] grantResults) {
switch (requestCode) {
- case PERMISSIONS_REQUEST_ACCESS_COARSE_LOCATION: {
+ case PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION: {
// If request is cancelled, the result arrays are empty.
mCurrentModule.waitingLocationPermissionResult(false);
if (grantResults.length > 0
diff --git a/src/com/android/camera/LocationManager.java b/src/com/android/camera/LocationManager.java
index 5aedf06..2ae901a 100755
--- a/src/com/android/camera/LocationManager.java
+++ b/src/com/android/camera/LocationManager.java
@@ -79,7 +79,7 @@ public class LocationManager {
}
private boolean hasLoationPermission() {
- return mContext.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
+ return mContext.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED;
}
diff --git a/src/com/android/camera/PermissionsActivity.java b/src/com/android/camera/PermissionsActivity.java
index 91699c3..fb0c080 100755
--- a/src/com/android/camera/PermissionsActivity.java
+++ b/src/com/android/camera/PermissionsActivity.java
@@ -79,7 +79,7 @@ public class PermissionsActivity extends Activity {
mFlagHasStoragePermission = true;
}
- if (checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
+ if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
mNumPermissionsToRequest++;
mShouldRequestLocationPermission = true;
@@ -119,7 +119,7 @@ public class PermissionsActivity extends Activity {
}
if (mShouldRequestLocationPermission) {
permissionsToRequest[permissionsRequestIndex] =
- Manifest.permission.ACCESS_COARSE_LOCATION;
+ Manifest.permission.ACCESS_FINE_LOCATION;
mIndexPermissionRequestLocation = permissionsRequestIndex;
}
requestPermissions(permissionsToRequest, PERMISSION_REQUEST_CODE);
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 8c6a86f..1783237 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -666,7 +666,7 @@ public class PhotoModule
// camera only
private void locationFirstRun() {
boolean enableRecordingLocation = false;
- if (mActivity.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
+ if (mActivity.checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION)
== PackageManager.PERMISSION_GRANTED) {
enableRecordingLocation = true;
}