From 2ab0113b1ec34c96b84e8be9aac1a3f1e9d3ccb8 Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Fri, 7 Sep 2012 18:03:35 +0800 Subject: Pass EXCLUDE_FROM_RECENTS when starting secure camera. Camera started from the secure lock screen does not show all the pictures in the camera roll. If users launch camera from recent apps, they may enter secure camera mode accidentally. Pass EXCLUDE_FROM_RECENTS flag to prevent this. bug:7053266 Change-Id: I0ad526d919dac02f358b25493777d7d73da6987f --- .../android/internal/policy/impl/keyguard/KeyguardSelectorView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java index 28f5e8ca7d6d..6e517075754b 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java @@ -131,7 +131,9 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri protected void launchCamera() { if (mLockPatternUtils.isSecure()) { // Launch the secure version of the camera - launchActivity(new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE), true); + Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE); + intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); + launchActivity(intent, true); } else { // Launch the normal camera launchActivity(new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA), false); @@ -230,7 +232,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri * See {@link WindowManager#FLAG_SHOW_WHEN_LOCKED} */ private void launchActivity(final Intent intent, boolean showsWhileLocked) { - intent.setFlags( + intent.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); -- cgit v1.2.3-59-g8ed1b