summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjunjiez <junjiez@codeaurora.org>2017-02-10 10:33:32 +0800
committerjunjiez <junjiez@codeaurora.org>2017-02-10 10:33:32 +0800
commitf74a9e584d85447506a5da17be73df8f6e2c89bf (patch)
tree1f80cacba461a9c305e9dad7b5fd776452223950 /src
parent7ba92496e19033b068849ad7fdc4b944e6c8e57b (diff)
downloadandroid_packages_apps_Snap-f74a9e584d85447506a5da17be73df8f6e2c89bf.tar.gz
android_packages_apps_Snap-f74a9e584d85447506a5da17be73df8f6e2c89bf.tar.bz2
android_packages_apps_Snap-f74a9e584d85447506a5da17be73df8f6e2c89bf.zip
SnapdragonCamera: Fix location option wrong
The record loaction option is still set to enable after loaction permission is not granted, to avoid this issue, always check location permission first. Change-Id: I96bc3a1102411e30b8f27c7e59fb3452b42706da CRs-Fixed: 1106767
Diffstat (limited to 'src')
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/PhotoModule.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 0db14c43e..f3bec263a 100644..100755
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -633,9 +633,15 @@ public class PhotoModule
// Prompt the user to pick to record location for the very first run of
// camera only
private void locationFirstRun() {
+ boolean enableRecordingLocation = false;
+ if (mActivity.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
+ == PackageManager.PERMISSION_GRANTED) {
+ enableRecordingLocation = true;
+ }
/* Do not prompt if the preference is already set, this is a secure
* camera session, or the prompt has already been triggered. */
- if (RecordLocationPreference.isSet(mPreferences, CameraSettings.KEY_RECORD_LOCATION) ||
+ if ((RecordLocationPreference.isSet(
+ mPreferences, CameraSettings.KEY_RECORD_LOCATION) && enableRecordingLocation) ||
mActivity.isSecureCamera() || mLocationPromptTriggered) {
return;
}
@@ -651,11 +657,6 @@ public class PhotoModule
/* Enable the location at the begining, always.
If the user denies the permission, it will be disabled
right away due to exception */
- boolean enableRecordingLocation = false;
- if (mActivity.checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION)
- == PackageManager.PERMISSION_GRANTED) {
- enableRecordingLocation = true;
- }
enableRecordingLocation(enableRecordingLocation);
}