summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweijiew <weijiew@codeaurora.org>2016-11-23 20:34:44 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-11-24 21:09:17 -0800
commitfe55beed76f25d83cb89104947eb36b7e6417f5a (patch)
tree859b33364cad625c59431ef34bf7b8112e698b55
parent92ea0735ed488f356fd9ae077df2629cc6f53e97 (diff)
downloadandroid_packages_apps_Snap-fe55beed76f25d83cb89104947eb36b7e6417f5a.tar.gz
android_packages_apps_Snap-fe55beed76f25d83cb89104947eb36b7e6417f5a.tar.bz2
android_packages_apps_Snap-fe55beed76f25d83cb89104947eb36b7e6417f5a.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/PhotoUI.java2
-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/VideoUI.java2
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java3
6 files changed, 20 insertions, 15 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index cfdd8af12..884fe142e 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -629,7 +629,7 @@ public class PhotoModule
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;
}
@@ -912,7 +912,8 @@ public class PhotoModule
}
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
mUI.initializeFirstTime();
@@ -943,7 +944,8 @@ public class PhotoModule
// 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) {
@@ -4673,7 +4675,8 @@ public class PhotoModule
// 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/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 250bfa603..442c65d94 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -728,7 +728,7 @@ public class PhotoUI implements PieListener,
// make sure the correct value was found
// otherwise use auto index
mOnScreenIndicators.updateWBIndicator(wbIndex < 0 ? 2 : wbIndex);
- boolean location = RecordLocationPreference.get(prefs);
+ boolean location = RecordLocationPreference.get(prefs, CameraSettings.KEY_RECORD_LOCATION);
mOnScreenIndicators.updateLocationIndicator(location);
}
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 21ad36fcf..e420addcb 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1158,7 +1158,8 @@ public class VideoModule implements CameraModule,
mOrientationManager.resume();
// Initialize location service.
- boolean recordLocation = RecordLocationPreference.get(mPreferences);
+ boolean recordLocation = RecordLocationPreference.get(mPreferences,
+ CameraSettings.KEY_RECORD_LOCATION);
mLocationManager.recordLocation(recordLocation);
if (mPreviewing) {
@@ -2798,7 +2799,8 @@ public class VideoModule implements CameraModule,
// startPreview().
if (mCameraDevice == null) return;
- 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/VideoUI.java b/src/com/android/camera/VideoUI.java
index c68d895ea..e853783a6 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -721,7 +721,7 @@ public class VideoUI implements PieRenderer.PieListener,
public void updateOnScreenIndicators(Parameters param, ComboPreferences prefs) {
mOnScreenIndicators.updateFlashOnScreenIndicator(param.getFlashMode());
- boolean location = RecordLocationPreference.get(prefs);
+ boolean location = RecordLocationPreference.get(prefs, CameraSettings.KEY_RECORD_LOCATION);
mOnScreenIndicators.updateLocationIndicator(location);
}
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 7a3b114d1..2d4ec1419 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -1046,7 +1046,8 @@ public class WideAnglePanoramaModule
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(