Skip to content

Commit f7178d3

Browse files
committed
Allow the secure keyguard to engage behind Dreams.
TYPE_DREAM windows are now considered for relevant window flags alongside application windows. Bug: 6961616 Change-Id: Idee3303276a8b69c7f07de1d6acdce64c6e1b863
1 parent 75f0fac commit f7178d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

core/java/android/service/dreams/Dream.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@ public void onDestroy() {
346346
lp.type = WindowManager.LayoutParams.TYPE_DREAM;
347347
lp.token = windowToken;
348348
lp.windowAnimations = com.android.internal.R.style.Animation_Dream;
349+
lp.flags |= ( WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
350+
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
351+
| WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
352+
);
353+
mWindow.setAttributes(lp);
349354

350355
//WindowManagerImpl.getDefault().addView(mWindow.getDecorView(), lp);
351356

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,8 +2854,8 @@ public void animatingWindowLw(WindowState win,
28542854
if ((attrs.flags & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
28552855
mForceStatusBar = true;
28562856
}
2857-
if (attrs.type >= FIRST_APPLICATION_WINDOW
2858-
&& attrs.type <= LAST_APPLICATION_WINDOW
2857+
if (((attrs.type >= FIRST_APPLICATION_WINDOW && attrs.type <= LAST_APPLICATION_WINDOW)
2858+
|| attrs.type == TYPE_DREAM)
28592859
&& attrs.x == 0 && attrs.y == 0
28602860
&& attrs.width == WindowManager.LayoutParams.MATCH_PARENT
28612861
&& attrs.height == WindowManager.LayoutParams.MATCH_PARENT) {

0 commit comments

Comments
 (0)