summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2015-04-17 17:28:57 +0800
committerRockchip2015-05-14 11:53:41 +0800
commit4ee05cf07806d58db41f864eb4c4cca968769a37 (patch)
tree6a09acb050ca335f50c7fc840c40f12abf817808
parent258c20c2bd7b9ffab09a705d5d1e53c7338a0ee0 (diff)
1.show error dialog when camera hal has error callback.
2.sync back/front camera between photoModule and videoModule.
-rw-r--r--src/com/android/camera/ButtonManager.java8
-rw-r--r--src/com/android/camera/CameraActivity.java1
-rw-r--r--src/com/android/camera/PhotoModule.java8
-rw-r--r--src/com/android/camera/VideoModule.java6
-rw-r--r--src/com/android/camera/app/CameraAppUI.java4
5 files changed, 14 insertions, 13 deletions
diff --git a/src/com/android/camera/ButtonManager.java b/src/com/android/camera/ButtonManager.java
index 3250c01..f275f7c 100644
--- a/src/com/android/camera/ButtonManager.java
+++ b/src/com/android/camera/ButtonManager.java
@@ -193,7 +193,7 @@ public class ButtonManager implements SettingsManager.OnSettingChangedListener {
Keys.KEY_HDR_PLUS_FLASH_MODE);
button = getButtonOrError(BUTTON_HDR_PLUS_FLASH);
} else if (key.equals(Keys.KEY_CAMERA_ID)) {
- index = mSettingsManager.getIndexOfCurrentValue(mAppController.getModuleScope(),
+ index = mSettingsManager.getIndexOfCurrentValue(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID);
button = getButtonOrError(BUTTON_CAMERA);
} else if (key.equals(Keys.KEY_CAMERA_HDR_PLUS)) {
@@ -692,16 +692,16 @@ public class ButtonManager implements SettingsManager.OnSettingChangedListener {
button.overrideImageIds(resIdImages);
}
- int index = mSettingsManager.getIndexOfCurrentValue(mAppController.getModuleScope(),
+ int index = mSettingsManager.getIndexOfCurrentValue(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID);
button.setState(index >= 0 ? index : 0, false);
button.setOnStateChangeListener(new MultiToggleImageButton.OnStateChangeListener() {
@Override
public void stateChanged(View view, int state) {
- mSettingsManager.setValueByIndex(mAppController.getModuleScope(),
+ mSettingsManager.setValueByIndex(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID, state);
- int cameraId = mSettingsManager.getInteger(mAppController.getModuleScope(),
+ int cameraId = mSettingsManager.getInteger(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID);
// This is a quick fix for ISE in Gcam module which can be
// found by rapid pressing camera switch button. The assumption
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 8c1d320..aad7f14 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1329,6 +1329,7 @@ public class CameraActivity extends QuickActivity
public void onCameraError(int errorCode) {
// Not a fatal error. only do Log.e().
Log.e(TAG, "Camera error callback. error=" + errorCode);
+ onFatalError();
}
@Override
public void onCameraException(
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index b4b5ee7..aa0dc55 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -423,7 +423,7 @@ public class PhotoModule
mActivity.setPreviewStatusListener(mUI);
SettingsManager settingsManager = mActivity.getSettingsManager();
- mCameraId = settingsManager.getInteger(mAppController.getModuleScope(),
+ mCameraId = settingsManager.getInteger(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID);
// TODO: Move this to SettingsManager as a part of upgrade procedure.
@@ -658,7 +658,7 @@ public class PhotoModule
closeCamera();
mCameraId = mPendingSwitchCameraId;
- settingsManager.set(mAppController.getModuleScope(), Keys.KEY_CAMERA_ID, mCameraId);
+ settingsManager.set(SettingsManager.SCOPE_GLOBAL, Keys.KEY_CAMERA_ID, mCameraId);
requestCameraOpen();
mUI.clearFaces();
if (mFocusManager != null) {
@@ -695,7 +695,7 @@ public class PhotoModule
// switch back to gcam, otherwise handle callback normally.
SettingsManager settingsManager = mActivity.getSettingsManager();
if (Keys.isCameraBackFacing(settingsManager,
- mAppController.getModuleScope())) {
+ SettingsManager.SCOPE_GLOBAL)) {
if (Keys.requestsReturnToHdrPlus(settingsManager,
mAppController.getModuleScope())) {
switchToGcamCapture();
@@ -721,7 +721,7 @@ public class PhotoModule
SettingsManager settingsManager = mActivity.getSettingsManager();
if (GcamHelper.hasGcamAsSeparateModule()) {
// Set the camera setting to default backfacing.
- settingsManager.setToDefault(mAppController.getModuleScope(),
+ settingsManager.setToDefault(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID);
switchToGcamCapture();
} else {
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index f363cc8..c87ba65 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -343,7 +343,7 @@ public class VideoModule extends CameraModule
mActivity.setPreviewStatusListener(mUI);
SettingsManager settingsManager = mActivity.getSettingsManager();
- mCameraId = settingsManager.getInteger(mAppController.getModuleScope(),
+ mCameraId = settingsManager.getInteger(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID);
/*
@@ -1634,7 +1634,7 @@ public class VideoModule extends CameraModule
mCameraSettings.setPreviewFrameRate(mProfile.videoFrameRate);
}
- enableTorchMode(Keys.isCameraBackFacing(settingsManager, mAppController.getModuleScope()));
+ enableTorchMode(Keys.isCameraBackFacing(settingsManager, SettingsManager.SCOPE_GLOBAL));
// Set zoom.
if (mCameraCapabilities.supports(CameraCapabilities.Feature.ZOOM)) {
@@ -1801,7 +1801,7 @@ public class VideoModule extends CameraModule
Log.d(TAG, "Start to switch camera.");
mCameraId = mPendingSwitchCameraId;
mPendingSwitchCameraId = -1;
- settingsManager.set(mAppController.getModuleScope(),
+ settingsManager.set(SettingsManager.SCOPE_GLOBAL,
Keys.KEY_CAMERA_ID, mCameraId);
if (mFocusManager != null) {
diff --git a/src/com/android/camera/app/CameraAppUI.java b/src/com/android/camera/app/CameraAppUI.java
index 834640e..d2ddbb7 100644
--- a/src/com/android/camera/app/CameraAppUI.java
+++ b/src/com/android/camera/app/CameraAppUI.java
@@ -1908,7 +1908,7 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
} else {
if (hardwareSpec.isHdrPlusSupported()) {
if (bottomBarSpec.enableHdr && Keys.isCameraBackFacing(settingsManager,
- mController.getModuleScope())) {
+ SettingsManager.SCOPE_GLOBAL)) {
buttonManager.initializeButton(ButtonManager.BUTTON_HDR_PLUS,
bottomBarSpec.hdrCallback);
} else {
@@ -1916,7 +1916,7 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
}
} else if (hardwareSpec.isHdrSupported()) {
if (bottomBarSpec.enableHdr && Keys.isCameraBackFacing(settingsManager,
- mController.getModuleScope())) {
+ SettingsManager.SCOPE_GLOBAL)) {
buttonManager.initializeButton(ButtonManager.BUTTON_HDR,
bottomBarSpec.hdrCallback);
} else {