summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordianlujitao <dianlujitao@lineageos.org>2019-11-20 11:38:21 +0800
committerdianlujitao <dianlujitao@lineageos.org>2019-11-21 23:38:19 +0800
commit8481d34d0ac0027703343baf9e5411e663b48235 (patch)
tree4007fdce8034deabd329e2f1c27530b7456cdf0d
parent227aeca12b620f096d6810252714099521ace473 (diff)
downloadandroid_packages_apps_Snap-8481d34d0ac0027703343baf9e5411e663b48235.zip
android_packages_apps_Snap-8481d34d0ac0027703343baf9e5411e663b48235.tar.gz
android_packages_apps_Snap-8481d34d0ac0027703343baf9e5411e663b48235.tar.bz2
Snap: Perform null check on AF state in updateCaptureStateMachine
* Some camera HAL implementations don't push AF state to urgent metadata. E.g. for QCOM camera HAL this happens only after https://source.codeaurora.org/quic/la/platform/hardware/qcom/camera/commit/?h=LA.UM.7.2.r1-07700-sdm660.0&id=d276a953295364b967c36038362c1e7ea268bdad * Fix crash on capture after c724bc35a9c5f3b36ce36a2081559e2644993da4 Change-Id: I8980fd3fb7d7db4f61189281580ecb17778602df
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 5cc20e0..5cd9715 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -1033,6 +1033,11 @@ public class CaptureModule implements CameraModule, PhotoController,
private void updateCaptureStateMachine(int id, CaptureResult result) {
Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);
Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
+
+ if (afState == null) {
+ return;
+ }
+
switch (mState[id]) {
case STATE_PREVIEW: {
break;