summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmilian Peev <epeevs@codeaurora.org>2016-01-07 19:57:10 +0100
committercodeworkx <codeworkx@cyanogenmod.org>2016-01-07 19:57:10 +0100
commit1e7abfa2eca0bca9413b2d3ce2c6410fe3e57690 (patch)
tree94ebae7a6f2aba551173b5ba1ac7f200b38b437b
parentd75e7c3fce543eea9fb632afa253f2eedda25846 (diff)
downloadandroid_packages_apps_Snap-1e7abfa2eca0bca9413b2d3ce2c6410fe3e57690.tar.gz
android_packages_apps_Snap-1e7abfa2eca0bca9413b2d3ce2c6410fe3e57690.tar.bz2
android_packages_apps_Snap-1e7abfa2eca0bca9413b2d3ce2c6410fe3e57690.zip
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
-rw-r--r--src/com/android/camera/PhotoModule.java6
1 files 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) {