summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-07-18 14:59:35 -0700
committerJay Wang <jaywang@codeaurora.org>2016-07-18 14:59:35 -0700
commit05181ebecc4e6f91e99c7254088ea0fd2f8291f6 (patch)
treef9ed027caaac0ae84f59e98b51ac7971a3ab3776
parentd8f8770adb894d7ccdedde05512be91885fec07f (diff)
downloadandroid_packages_apps_Snap-05181ebecc4e6f91e99c7254088ea0fd2f8291f6.tar.gz
android_packages_apps_Snap-05181ebecc4e6f91e99c7254088ea0fd2f8291f6.tar.bz2
android_packages_apps_Snap-05181ebecc4e6f91e99c7254088ea0fd2f8291f6.zip
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
-rw-r--r--src/com/android/camera/PhotoModule.java9
-rw-r--r--src/com/android/camera/PhotoUI.java9
2 files changed, 14 insertions, 4 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 6f116ab24..028bfd1e2 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1258,13 +1258,14 @@ public class PhotoModule
public void onPictureTaken(final byte [] jpegData, CameraProxy camera) {
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 (mInstantCaptureSnapShot == true) {
Log.v(TAG, "Instant capture picture taken!");
mInstantCaptureSnapShot = false;
-
- // 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 7c715d9fd..daec2df4c 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -1247,6 +1247,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();