From b3ad5e2ecf348fd8621995d711bf9e31b5c0e1bc Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Tue, 13 Sep 2016 13:05:33 -0700 Subject: SnapdragonCamera: Only release shutter for main cam Only release shutter when main camera is unlocked. Queueing two runnables can result in race condition where shutter is re-enabled after being disabled due to shutter click. CRs-Fixed: 1068525 Change-Id: I70def909e4c2c0eafc15e31475992248da3b74b7 --- src/com/android/camera/CaptureModule.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/com/android/camera/CaptureModule.java') diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index 8f2006a1c..c914b8602 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1456,13 +1456,15 @@ public class CaptureModule implements CameraModule, PhotoController, applySettingsForUnlockExposure(mPreviewRequestBuilder[id], id); setAFModeToPreview(id, mControlAFMode); mTakingPicture[id] = false; - mActivity.runOnUiThread(new Runnable() { - @Override - public void run() { - mUI.stopSelfieFlash(); - mUI.enableShutter(true); - } - }); + if (id == getMainCameraId()) { + mActivity.runOnUiThread(new Runnable() { + @Override + public void run() { + mUI.stopSelfieFlash(); + mUI.enableShutter(true); + } + }); + } } catch (CameraAccessException e) { e.printStackTrace(); } -- cgit v1.2.3