From db4f5342e80662985c8bcb208e4fabf5c8db8a1a Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Mon, 18 Jul 2016 14:59:35 -0700 Subject: SnapdragonCamera: Force removing preview cover A workaround to remove preview cover after picture is taken, if preview cover is not removed right after preview started. Change-Id: I723d70fde6ecaf7302714daa6648c85d8a40d1b4 CRs-Fixed: 1016691 --- src/com/android/camera/PhotoModule.java | 5 +++++ src/com/android/camera/PhotoUI.java | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 1d49cfbd5..ea717a449 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -1239,6 +1239,11 @@ public class PhotoModule mUI.stopSelfieFlash(); mUI.enableShutter(true); } + if (mUI.isPreviewCoverVisible()) { + // When take picture request is sent before starting preview, onPreviewFrame() + // callback doesn't happen so removing preview cover here, instead. + mUI.hidePreviewCover(); + } if (mPaused) { return; } diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 23ed1bad4..7762d1426 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -1164,6 +1164,15 @@ public class PhotoUI implements PieListener, } } + public boolean isPreviewCoverVisible() { + if ((mPreviewCover != null) && + (mPreviewCover.getVisibility() == View.VISIBLE)) { + return true; + } else { + return false; + } + } + public void onPause() { cancelCountDown(); -- cgit v1.2.3