summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/Camera.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/Camera.java')
-rw-r--r--src/com/android/camera/Camera.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index b50ab18..254db28 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -100,6 +100,10 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
private static final int SHOW_TAP_TO_FOCUS_TOAST = 6;
private static final int UPDATE_THUMBNAIL = 7;
+ // This is the delay before we execute onResume tasks when coming
+ // from the lock screen, to allow time for onPause to execute.
+ private static final int ON_RESUME_TASKS_DELAY_MSEC = 20;
+
// The subset of parameters we need to update in setCameraParameters().
private static final int UPDATE_PARAM_INITIALIZE = 1;
private static final int UPDATE_PARAM_ZOOM = 2;
@@ -1358,7 +1362,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
@OnClickAttr
public void onThumbnailClicked(View v) {
- if (isCameraIdle() && mThumbnail != null) {
+ if (isCameraIdle() && mThumbnail != null && !isCameraSecure()) {
showSharePopup();
}
}
@@ -2331,4 +2335,27 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
mAeLockSupported = mInitialParams.isAutoExposureLockSupported();
mAwbLockSupported = mInitialParams.isAutoWhiteBalanceLockSupported();
}
+
+ @Override
+ public void onResumeAfterSuper() {
+ // 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.
+ String action = getIntent().getAction();
+ if (isCameraSecure()) {
+ Log.v(TAG, "On resume, from lock screen.");
+ // Note: onPauseAfterSuper() will delete this runnable, so we will
+ // at most have 1 copy queued up.
+ mHandler.postDelayed(new Runnable() {
+ public void run() {
+ doOnResume();
+ }
+ }, ON_RESUME_TASKS_DELAY_MSEC);
+ // show on lock screen
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+ } else {
+ Log.v(TAG, "On resume.");
+ doOnResume();
+ }
+ }
}