From 1e7abfa2eca0bca9413b2d3ce2c6410fe3e57690 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Thu, 7 Jan 2016 19:57:10 +0100 Subject: Snapdragon Camera: Avoid null pointer exception during shutter focus An additional check needs to be added for the focus manager initialization during handling of the shutter button focus event. Change-Id: Icc12bd47b52af36e2ec5c1415d1147ba925a585b CRs-Fixed: 766843 --- src/com/android/camera/PhotoModule.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 6a6c83145..8acb52dee 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -2055,7 +2055,8 @@ public class PhotoModule if (mCameraDevice == null || mPaused || mUI.collapseCameraControls() || (mCameraState == SNAPSHOT_IN_PROGRESS) - || (mCameraState == PREVIEW_STOPPED)) { + || (mCameraState == PREVIEW_STOPPED) + || (null == mFocusManager)) { Log.v(TAG, "onShutterButtonFocus error case mCameraState = " + mCameraState + "mCameraDevice = " + mCameraDevice + "mPaused =" + mPaused); return; @@ -2087,7 +2088,8 @@ public class PhotoModule if (mPaused || mShutterPressing || mUI.collapseCameraControls() || (mCameraState == SWITCHING_CAMERA) - || (mCameraState == PREVIEW_STOPPED)) return; + || (mCameraState == PREVIEW_STOPPED) + || (null == mFocusManager)) return; mShutterPressing = true; // Do not take the picture if there is not enough storage. if (mActivity.getStorageSpaceBytes() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) { -- cgit v1.2.3