summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-19 18:11:05 -0700
committerJay Wang <jaywang@codeaurora.org>2016-07-19 18:33:27 -0700
commit56aabdf703779b97ef40cbef8fcde2620a379028 (patch)
tree6710a435e25aff3cda02545658f023151e93f896 /src/com/android/camera/CaptureModule.java
parentd8f8770adb894d7ccdedde05512be91885fec07f (diff)
downloadandroid_packages_apps_Snap-56aabdf703779b97ef40cbef8fcde2620a379028.tar.gz
android_packages_apps_Snap-56aabdf703779b97ef40cbef8fcde2620a379028.tar.bz2
android_packages_apps_Snap-56aabdf703779b97ef40cbef8fcde2620a379028.zip
SnapdragonCamera: Remove custom location permission request window
When user enables the GPS locaion setting, use Android's run-time permission request interface to get the permission. Change-Id: Ib17171aeff5ccf20e2b00da08243dee1a3383611 CRs-Fixed: 1038039
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rw-r--r--src/com/android/camera/CaptureModule.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index a7448aedb..baf8b843c 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -102,7 +102,8 @@ import java.util.concurrent.TimeUnit;
public class CaptureModule implements CameraModule, PhotoController,
MediaSaveService.Listener, ClearSightImageProcessor.Callback,
- SettingsManager.Listener, CountDownView.OnCountDownFinishedListener {
+ SettingsManager.Listener, LocationManager.Listener,
+ CountDownView.OnCountDownFinishedListener {
public static final int DUAL_MODE = 0;
public static final int BAYER_MODE = 1;
public static final int MONO_MODE = 2;
@@ -806,7 +807,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mUI.initializeControlByIntent();
mFocusStateListener = new FocusStateListener(mUI);
- mLocationManager = new LocationManager(mActivity, mUI);
+ mLocationManager = new LocationManager(mActivity, this);
Storage.setSaveSDCard(mSettingsManager.getValue(SettingsManager
.KEY_CAMERA_SAVEPATH).equals("1"));
}
@@ -1859,8 +1860,16 @@ public class CaptureModule implements CameraModule, PhotoController,
}
@Override
- public void enableRecordingLocation(boolean enable) {
+ public void waitingLocationPermissionResult(boolean result) {
+ mLocationManager.waitingLocationPermissionResult(result);
+ }
+ @Override
+ public void enableRecordingLocation(boolean enable) {
+ String value = (enable ? RecordLocationPreference.VALUE_ON
+ : RecordLocationPreference.VALUE_OFF);
+ mSettingsManager.setValue(SettingsManager.KEY_RECORD_LOCATION, value);
+ mLocationManager.recordLocation(enable);
}
@Override
@@ -3080,4 +3089,9 @@ public class CaptureModule implements CameraModule, PhotoController,
}
}
}
+
+ @Override
+ public void onErrorListener(int error) {
+ enableRecordingLocation(false);
+ }
}