From a6149d3035480e777301aa678b2f8dd7d10d10a7 Mon Sep 17 00:00:00 2001 From: Wolfgang Wiedmeyer Date: Fri, 9 Oct 2015 21:58:49 +0200 Subject: make Camera work on lock screen (secure mode) Change-Id: I2ea9993738430f8c59f9e69cd2f75e6acccdc9eb --- AndroidManifest.xml | 8 +++++ src/com/android/camera/ActivityBase.java | 50 +++++++++++++++++++++++++++++++- src/com/android/camera/Camera.java | 29 +++++++++++++++++- src/com/android/camera/VideoCamera.java | 2 +- 4 files changed, 86 insertions(+), 3 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index ee57c31..c9023aa 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -45,6 +45,14 @@ + + + + + + + + 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(); + } + } } diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index b2626ed..2190c48 100755 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -608,7 +608,7 @@ public class VideoCamera extends ActivityBase @OnClickAttr public void onThumbnailClicked(View v) { - if (!mMediaRecorderRecording && mThumbnail != null) { + if (!mMediaRecorderRecording && mThumbnail != null && !isCameraSecure()) { showSharePopup(); } } -- cgit v1.1