summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 19c80a72b..543e67231 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -168,8 +168,6 @@ public class CameraActivity extends Activity
/** Whether onResume should reset the view to the preview. */
private boolean mResetToPreviewOnResume = true;
- public static boolean CAMERA_2_ON = false;
-
// Supported operations at FilmStripView. Different data has different
// set of supported operations.
private static final int SUPPORT_DELETE = 1 << 0;
@@ -1491,6 +1489,8 @@ public class CameraActivity extends Activity
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
+ SettingsManager.createInstance(this);
+
LayoutInflater inflater = getLayoutInflater();
View rootLayout = inflater.inflate(R.layout.camera, null, false);
mCameraRootFrame = (FrameLayout)rootLayout.findViewById(R.id.camera_root_frame);
@@ -1525,10 +1525,9 @@ public class CameraActivity extends Activity
moduleIndex = ModuleSwitcher.PHOTO_MODULE_INDEX;
}
}
- SharedPreferences pref = PreferenceManager
- .getDefaultSharedPreferences(this);
- CAMERA_2_ON = pref.getBoolean(CameraSettings.KEY_CAMERA2, false);
- if (CAMERA_2_ON && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX)
+
+ boolean cam2on = SettingsManager.getInstance().isCamera2On();
+ if (cam2on && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX)
moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX;
setContentView(R.layout.camera_filmstrip);
@@ -2017,7 +2016,9 @@ public class CameraActivity extends Activity
@Override
public void onModuleSelected(int moduleIndex) {
- if (moduleIndex == 0 && CAMERA_2_ON) moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX;
+ boolean cam2on = SettingsManager.getInstance().isCamera2On();
+ if (cam2on && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX)
+ moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX;
if (mCurrentModuleIndex == moduleIndex) {
if (mCurrentModuleIndex != ModuleSwitcher.CAPTURE_MODULE_INDEX) {
return;