Skip to content

Commit 2ab0113

Browse files
author
Wu-cheng Li
committed
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
1 parent 4848f42 commit 2ab0113

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public KeyguardSelectorView(Context context) {
131131
protected void launchCamera() {
132132
if (mLockPatternUtils.isSecure()) {
133133
// Launch the secure version of the camera
134-
launchActivity(new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE), true);
134+
Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE);
135+
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
136+
launchActivity(intent, true);
135137
} else {
136138
// Launch the normal camera
137139
launchActivity(new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA), false);
@@ -230,7 +232,7 @@ public void setLockPatternUtils(LockPatternUtils utils) {
230232
* See {@link WindowManager#FLAG_SHOW_WHEN_LOCKED}
231233
*/
232234
private void launchActivity(final Intent intent, boolean showsWhileLocked) {
233-
intent.setFlags(
235+
intent.addFlags(
234236
Intent.FLAG_ACTIVITY_NEW_TASK
235237
| Intent.FLAG_ACTIVITY_SINGLE_TOP
236238
| Intent.FLAG_ACTIVITY_CLEAR_TOP);

0 commit comments

Comments
 (0)