summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-03-24 16:14:15 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-04-11 16:24:36 -0700
commit4b33265c83966f70d4ef5cbe5c182d7dc670e5ee (patch)
tree5c6d800bf6cd806dc09c23e980de18bc4e7bc8ab /src/com
parentd2d5304399167d790ae3e400c1815253e26d917f (diff)
downloadandroid_packages_apps_Snap-4b33265c83966f70d4ef5cbe5c182d7dc670e5ee.tar.gz
android_packages_apps_Snap-4b33265c83966f70d4ef5cbe5c182d7dc670e5ee.tar.bz2
android_packages_apps_Snap-4b33265c83966f70d4ef5cbe5c182d7dc670e5ee.zip
SnapdragonCamera: hide the preview surface during suspend
Occasionally, the previous preview frame is presented and caused the screen flashing, when continuously triggering suspend/resume. To resolve the issue, hide the preview surface during suspend and make it visible during resume. This helps to clear the remaining preview frames in the buffer. CRs-Fixed: 991416 Change-Id: I96fff0fdae6bd14263f33b1a9032604596cf49c1
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/PhotoModule.java2
-rw-r--r--src/com/android/camera/PhotoUI.java7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index d7f38a156..e10d33b93 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2364,6 +2364,7 @@ public class PhotoModule
@Override
public void onResumeAfterSuper() {
mLastPhotoTakenWithRefocus = false;
+ mUI.showSurfaceView();
// Add delay on resume from lock screen only, in order to to speed up
// the onResume --> onPause --> onResume cycle from lock screen.
// Don't do always because letting go of thread can cause delay.
@@ -2491,6 +2492,7 @@ public class PhotoModule
public void onPauseAfterSuper() {
Log.v(TAG, "On pause.");
mUI.showPreviewCover();
+ mUI.hideSurfaceView();
try {
if (mOpenCameraThread != null) {
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 02d8f7183..06f5604ba 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -1181,6 +1181,13 @@ public class PhotoUI implements PieListener,
return mSurfaceHolder;
}
+ public void hideSurfaceView() {
+ mSurfaceView.setVisibility(View.INVISIBLE);
+ }
+
+ public void showSurfaceView() {
+ mSurfaceView.setVisibility(View.VISIBLE);
+ }
// Countdown timer
private void initializeCountDown() {