summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CaptureModule.java
diff options
context:
space:
mode:
authorqimengp <qimengp@codeaurora.org>2016-12-12 19:37:36 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-13 17:34:41 -0800
commit6f62c42fb9b9895493cf82b2f7a833e677e6ae7c (patch)
tree259f1f4c77ecfce79b7234d3db4fa485d38505a4 /src/com/android/camera/CaptureModule.java
parent87d662fe60738338359c8a5e113260e6c01b6ab8 (diff)
downloadandroid_packages_apps_Snap-6f62c42fb9b9895493cf82b2f7a833e677e6ae7c.tar.gz
android_packages_apps_Snap-6f62c42fb9b9895493cf82b2f7a833e677e6ae7c.tar.bz2
android_packages_apps_Snap-6f62c42fb9b9895493cf82b2f7a833e677e6ae7c.zip
SnapdragonCamera: Fix shutter button grey
Shuter button will be grey in some situation. we need to reset Button state and state machine. Change-Id: I0c8170ff8338297659405d97ba9a7e2ae64b8f5f
Diffstat (limited to 'src/com/android/camera/CaptureModule.java')
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index dd63a9f66..4d4b1d750 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -923,7 +923,7 @@ public class CaptureModule implements CameraModule, PhotoController,
@Override
public void onConfigureFailed(CameraCaptureSession cameraCaptureSession) {
- Log.e(TAG, "cameracapturesession - onConfigureFailed "+id);
+ Log.e(TAG, "cameracapturesession - onConfigureFailed "+ id);
if (mActivity.isFinishing()) {
return;
}
@@ -1144,6 +1144,7 @@ public class CaptureModule implements CameraModule, PhotoController,
private void lockFocus(int id) {
if (mActivity == null || mCameraDevice[id] == null
|| !checkSessionAndBuilder(mCaptureSession[id], mPreviewRequestBuilder[id])) {
+ mUI.enableShutter(true);
warningToast("Camera is not ready yet to take a picture.");
return;
}
@@ -3343,7 +3344,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
private void estimateJpegFileSize() {
- String quality = mSettingsManager.getValue(SettingsManager
+ String quality = mSettingsManager.getValue(SettingsManager
.KEY_JPEG_QUALITY);
int[] ratios = mActivity.getResources().getIntArray(R.array.jpegquality_compression_ratio);
String[] qualities = mActivity.getResources().getStringArray(
@@ -3903,6 +3904,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
public void restartSession(boolean isSurfaceChanged) {
+ Log.d(TAG, "restartSession isSurfaceChanged = " + isSurfaceChanged);
if (isAllSessionClosed()) return;
closeProcessors();
@@ -3921,8 +3923,17 @@ public class CaptureModule implements CameraModule, PhotoController,
if(isTrackingFocusSettingOn()) {
mUI.resetTrackingFocus();
}
+ resetStateMachine();
+ }
+
+ private void resetStateMachine() {
+ for (int i = 0; i < MAX_NUM_CAM; i++) {
+ mState[i] = STATE_PREVIEW;
+ }
+ mUI.enableShutter(true);
}
+
private Size getOptimalPreviewSize(Size pictureSize, Size[] prevSizes, int screenW, int
screenH) {
if (pictureSize.getWidth() <= screenH && pictureSize.getHeight() <= screenW) {