From 638172e20dcad32ca3d79b599eb6054c3acd5443 Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Fri, 19 Aug 2016 16:41:49 -0700 Subject: SnapdragonCamera: Close aux camera first when shutting down Close the mono camera first when shutting down cameras. CRs-Fixed: 1054456 Change-Id: I6e58f5b0e6263e4234d0278eb20c68ef01f02bc5 --- src/com/android/camera/CaptureModule.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 82b8e9b94..f1fd71a11 100644 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -1460,7 +1460,8 @@ public class CaptureModule implements CameraModule, PhotoController, mFrameProcessor.onClose(); } - for (int i = 0; i < MAX_NUM_CAM; i++) { + // Close camera starting with AUX first + for (int i = MAX_NUM_CAM-1; i >= 0; i--) { if (null != mCaptureSession[i]) { if (mIsLinked && mCamerasOpened) { unLinkBayerMono(i); @@ -1489,7 +1490,8 @@ public class CaptureModule implements CameraModule, PhotoController, try { mCameraOpenCloseLock.acquire(); - for (int i = 0; i < MAX_NUM_CAM; i++) { + // Close camera starting with AUX first + for (int i = MAX_NUM_CAM-1; i >= 0; i--) { if (null != mCameraDevice[i]) { mCameraDevice[i].close(); mCameraDevice[i] = null; -- cgit v1.2.3