diff options
author | Camera Software Integration <camswint@localhost> | 2016-10-13 02:52:53 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-10-13 02:52:53 -0700 |
commit | f0b21acf64117e1717760dfc7c8ad926b60d22c0 (patch) | |
tree | 5ae1beb911ad35b3a8f4db266d0b1c109e76c162 /src/com | |
parent | 41db28d56ed43a447bf6faf51fac47caca6d91f8 (diff) | |
parent | 93aeb670e817986817ce585aa6deaf1c4945dabe (diff) | |
download | android_packages_apps_Snap-f0b21acf64117e1717760dfc7c8ad926b60d22c0.tar.gz android_packages_apps_Snap-f0b21acf64117e1717760dfc7c8ad926b60d22c0.tar.bz2 android_packages_apps_Snap-f0b21acf64117e1717760dfc7c8ad926b60d22c0.zip |
Merge "SnapdragonCamera: Use constant obj when queueing and removing msg" into camera.lnx.1.0.c7-dev
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/CaptureModule.java | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index cbf2afba4..45b47e2d1 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -488,7 +488,7 @@ public class CaptureModule implements CameraModule, PhotoController, mCameraOpened[id] = true; if (isBackCamera() && getCameraMode() == DUAL_MODE && id == BAYER_ID) { - Message msg = mCameraHandler.obtainMessage(OPEN_CAMERA, MONO_ID); + Message msg = mCameraHandler.obtainMessage(OPEN_CAMERA, MONO_ID, 0); mCameraHandler.sendMessage(msg); } else { mCamerasOpened = true; @@ -1012,7 +1012,7 @@ public class CaptureModule implements CameraModule, PhotoController, mTakingPicture[id] = true; if (mState[id] == STATE_WAITING_TOUCH_FOCUS) { - mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, id); + mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, mCameraId[id]); mState[id] = STATE_WAITING_AF_LOCK; return; } @@ -1050,7 +1050,7 @@ public class CaptureModule implements CameraModule, PhotoController, mState[id] = STATE_WAITING_TOUCH_FOCUS; mCaptureSession[id].capture(builder.build(), mCaptureCallback, mCameraHandler); setAFModeToPreview(id, mControlAFMode); - Message message = mCameraHandler.obtainMessage(CANCEL_TOUCH_FOCUS, id); + Message message = mCameraHandler.obtainMessage(CANCEL_TOUCH_FOCUS, mCameraId[id]); mCameraHandler.sendMessageDelayed(message, CANCEL_TOUCH_FOCUS_DELAY); } catch (CameraAccessException e) { e.printStackTrace(); @@ -1882,17 +1882,16 @@ public class CaptureModule implements CameraModule, PhotoController, switch (getCameraMode()) { case DUAL_MODE: case BAYER_MODE: - msg.obj = BAYER_ID; + msg.arg1 = BAYER_ID; mCameraHandler.sendMessage(msg); break; case MONO_MODE: - msg.what = OPEN_CAMERA; - msg.obj = MONO_ID; + msg.arg1 = MONO_ID; mCameraHandler.sendMessage(msg); break; } } else { - msg.obj = FRONT_ID; + msg.arg1 = FRONT_ID; mCameraHandler.sendMessage(msg); } if (!mFirstTimeInitialized) { @@ -2323,7 +2322,7 @@ public class CaptureModule implements CameraModule, PhotoController, mMediaRecorderPausing = false; mUI.hideUIwhileRecording(); mUI.clearFocus(); - mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, cameraId); + mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, mCameraId[cameraId]); mState[cameraId] = STATE_PREVIEW; mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE; closePreviewSession(); @@ -3154,10 +3153,19 @@ public class CaptureModule implements CameraModule, PhotoController, int height = p.y; mAFRegions[id] = afaeRectangle(x, y, width, height, 1f, mCropRegion[id]); mAERegions[id] = afaeRectangle(x, y, width, height, 1.5f, mCropRegion[id]); - mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, id); + mCameraHandler.removeMessages(CANCEL_TOUCH_FOCUS, mCameraId[id]); autoFocusTrigger(id); } + private void cancelTouchFocus(int id) { + if(mPaused) + return; + + mState[id] = STATE_PREVIEW; + mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE; + setAFModeToPreview(id, mControlAFMode); + } + private MeteringRectangle[] afaeRectangle(float x, float y, int width, int height, float multiple, Rect cropRegion) { int side = (int) (Math.max(width, height) / 8 * multiple); @@ -3440,15 +3448,13 @@ public class CaptureModule implements CameraModule, PhotoController, @Override public void handleMessage(Message msg) { - int id = (int) msg.obj; + int id = msg.arg1; switch (msg.what) { case OPEN_CAMERA: openCamera(id); break; case CANCEL_TOUCH_FOCUS: - mState[id] = STATE_PREVIEW; - mControlAFMode = CaptureRequest.CONTROL_AF_MODE_CONTINUOUS_PICTURE; - setAFModeToPreview(id, mControlAFMode); + cancelTouchFocus(id); break; } } |