summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweijiew <weijiew@codeaurora.org>2016-11-23 20:34:44 +0800
committerDaniel Hillenbrand <daniel.hillenbrand@codeworkx.de>2017-05-30 17:43:18 +0000
commit018fdd0c54ddd98eb6e5f5a60a29e6fc350c5040 (patch)
tree2459b29e6b11cd21fb557b92f8347929d0bd2064
parent26d9aecb6f444e2d5d0543b238de78a13fc87558 (diff)
downloadandroid_packages_apps_Snap-018fdd0c54ddd98eb6e5f5a60a29e6fc350c5040.tar.gz
android_packages_apps_Snap-018fdd0c54ddd98eb6e5f5a60a29e6fc350c5040.tar.bz2
android_packages_apps_Snap-018fdd0c54ddd98eb6e5f5a60a29e6fc350c5040.zip
SnapdragonCamera: GPS location can't be turn On in camera settings
In Camera2, SharedPreferences persistes GPS location value by key(pref_camera2_recordlocation_key), but gets GPS location value by key(pref_camera_recordlocation_key). CRs-Fixed: 1088262 Change-Id: I33ddeb8f20fed03449bded2760c0ad1b8e36c91c
-rw-r--r--src/com/android/camera/PhotoModule.java11
-rw-r--r--src/com/android/camera/RecordLocationPreference.java11
-rw-r--r--src/com/android/camera/VideoModule.java6
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java3
4 files changed, 18 insertions, 13 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index cef508505..c9fe96006 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -619,7 +619,7 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
private void locationFirstRun() {
/* 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) ||
+ if (RecordLocationPreference.isSet(mPreferences, CameraSettings.KEY_RECORD_LOCATION) ||
mActivity.isSecureCamera() || mLocationPromptTriggered) {
return;
}
@@ -902,7 +902,8 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
}
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
mUI.initializeFirstTime();
@@ -925,7 +926,8 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
// onResume.
private void initializeSecondTime() {
// Start location update if needed.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
MediaSaveService s = mActivity.getMediaSaveService();
if (s != null) {
@@ -4750,7 +4752,8 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
// ignore the events after "onPause()"
if (mPaused) return;
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
if(needRestart()){
Log.v(TAG, "Restarting Preview... Camera Mode Changed");
diff --git a/src/com/android/camera/RecordLocationPreference.java b/src/com/android/camera/RecordLocationPreference.java
index b88f5e4ed..088ff663f 100644
--- a/src/com/android/camera/RecordLocationPreference.java
+++ b/src/com/android/camera/RecordLocationPreference.java
@@ -40,18 +40,17 @@ public class RecordLocationPreference extends IconListPreference {
@Override
public String getValue() {
- return get(getSharedPreferences()) ? VALUE_ON : VALUE_OFF;
+ return get(getSharedPreferences(), getKey()) ? VALUE_ON : VALUE_OFF;
}
- public static boolean get(SharedPreferences pref) {
- String value = pref.getString(
- CameraSettings.KEY_RECORD_LOCATION, VALUE_NONE);
+ public static boolean get(SharedPreferences pref, String key) {
+ String value = pref.getString(key, VALUE_NONE);
return VALUE_ON.equals(value);
}
- public static boolean isSet(SharedPreferences pref) {
+ public static boolean isSet(SharedPreferences pref, String key) {
String value = pref.getString(
- CameraSettings.KEY_RECORD_LOCATION, VALUE_NONE);
+ key, VALUE_NONE);
return !VALUE_NONE.equals(value);
}
}
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 83f40aeb9..dd9c9bbc5 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -500,7 +500,8 @@ public class VideoModule extends BaseModule<VideoUI> implements
}
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
mUI.initializeFirstTime();
@@ -2973,7 +2974,8 @@ public class VideoModule extends BaseModule<VideoUI> implements
synchronized (mCameraDevice) {
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
readVideoPreferences();
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index eda0f70ff..ec61da4bb 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -1065,7 +1065,8 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp
mOrientationManager.resume();
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
mUI.initDisplayChangeListener();
UsageStatistics.onContentViewChanged(