summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r--src/com/android/camera/PhotoModule.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 028bfd1e2..0b8cee802 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -112,6 +112,7 @@ public class PhotoModule
ShutterButton.OnShutterButtonListener,
MediaSaveService.Listener,
OnCountDownFinishedListener,
+ LocationManager.Listener,
SensorEventListener, MakeupLevelListener {
private static final String TAG = "CAM_PhotoModule";
@@ -582,7 +583,7 @@ public class PhotoModule
}
initializeControlByIntent();
mQuickCapture = mActivity.getIntent().getBooleanExtra(EXTRA_QUICK_CAPTURE, false);
- mLocationManager = new LocationManager(mActivity, mUI);
+ mLocationManager = new LocationManager(mActivity, this);
mSensorManager = (SensorManager)(mActivity.getSystemService(Context.SENSOR_SERVICE));
brightnessProgressBar = (ProgressBar)mRootView.findViewById(R.id.progress);
@@ -635,13 +636,23 @@ public class PhotoModule
}
mLocationPromptTriggered = true;
- mUI.showLocationDialog();
+
+ /* Enable the location at the begining, always.
+ If the user denies the permission, it will be disabled
+ right away due to exception */
+ enableRecordingLocation(true);
+ }
+
+ @Override
+ public void waitingLocationPermissionResult(boolean result) {
+ mLocationManager.waitingLocationPermissionResult(result);
}
@Override
public void enableRecordingLocation(boolean enable) {
setLocationPreference(enable ? RecordLocationPreference.VALUE_ON
: RecordLocationPreference.VALUE_OFF);
+ mLocationManager.recordLocation(enable);
}
@Override
@@ -687,7 +698,9 @@ public class PhotoModule
.apply();
// TODO: Fix this to use the actual onSharedPreferencesChanged listener
// instead of invoking manually
- onSharedPreferenceChanged();
+ if (mUI.mMenuInitialized) {
+ onSharedPreferenceChanged();
+ }
}
private void onCameraOpened() {
@@ -4855,6 +4868,12 @@ public class PhotoModule
mCameraDevice.setParameters(mParameters);
mParameters = mCameraDevice.getParameters();
}
+
+ @Override
+ public void onErrorListener(int error) {
+ enableRecordingLocation(false);
+ }
+
}
/* Below is no longer needed, except to get rid of compile error