summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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(