summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-01-18 14:16:36 -0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-02-11 03:43:58 +0200
commitc74d3ee93806b1e60d683b383a45657bd40f742c (patch)
tree1fecf29f48ed8c6ac01b56e28b0ac88dfe666bb9
parentda3f7c10237a7cab50607b31a066d68ee708483f (diff)
downloadandroid_packages_apps_Snap-c74d3ee93806b1e60d683b383a45657bd40f742c.zip
android_packages_apps_Snap-c74d3ee93806b1e60d683b383a45657bd40f742c.tar.gz
android_packages_apps_Snap-c74d3ee93806b1e60d683b383a45657bd40f742c.tar.bz2
SnapdragonCamera: Fix NULL pointer exception
There is a corner case that onShutterButtonClick() is called before camera device is configured. The change will make sure the camera device exists before continuing the operation. Change-Id: I2212572ea5c6073c3f62bdd38e83716b2427c87d CRs-Fixed: 962579
-rw-r--r--src/com/android/camera/PhotoModule.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 2fbe768..3e5e9bf 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2083,7 +2083,8 @@ public class PhotoModule
@Override
public synchronized void onShutterButtonClick() {
- if (mPaused || mShutterPressing
+ if ((mCameraDevice == null)
+ || mPaused || mShutterPressing
|| mUI.collapseCameraControls()
|| (mCameraState == SWITCHING_CAMERA)
|| (mCameraState == PREVIEW_STOPPED)