summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJay Wang <jaywang@codeaurora.org>2016-03-24 16:14:15 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-03 15:45:46 -0700
commit72a66ba511689265868439282361a353fa348fe5 (patch)
treee52227e63e1a5f6e62bd0355bcd5189ff9f1c788 /src/com
parent4180e3b9dd5c8ae712d9dd791f5f69205cefcbeb (diff)
downloadandroid_packages_apps_Snap-72a66ba511689265868439282361a353fa348fe5.tar.gz
android_packages_apps_Snap-72a66ba511689265868439282361a353fa348fe5.tar.bz2
android_packages_apps_Snap-72a66ba511689265868439282361a353fa348fe5.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 6702df316..b7a9dd88a 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2357,6 +2357,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.
@@ -2464,6 +2465,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 c3bdfa6c4..dd2055527 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -1089,6 +1089,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() {