Skip to content

Commit c8018eb

Browse files
author
Jeff Brown
committed
Fix dream/keyguard infinite layout loop.
Bug: 7427191 Change-Id: If48d39cf890274607fd13cdd4d85c6c234ce5a2c
1 parent 83f60c5 commit c8018eb

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2953,10 +2953,11 @@ public void applyPostLayoutPolicyLw(WindowState win,
29532953
boolean applyWindow = attrs.type >= FIRST_APPLICATION_WINDOW
29542954
&& attrs.type <= LAST_APPLICATION_WINDOW;
29552955
if (attrs.type == TYPE_DREAM) {
2956-
mShowingDream = true;
2957-
if (!mDreamingLockscreen) {
2958-
applyWindow = true;
2959-
} else if (win.isVisibleLw() && win.hasDrawnLw()) {
2956+
// If the lockscreen was showing when the dream started then wait
2957+
// for the dream to draw before hiding the lockscreen.
2958+
if (!mDreamingLockscreen
2959+
|| (win.isVisibleLw() && win.hasDrawnLw())) {
2960+
mShowingDream = true;
29602961
applyWindow = true;
29612962
}
29622963
}
@@ -2992,8 +2993,10 @@ public int finishPostLayoutPolicyLw() {
29922993
? mTopFullscreenOpaqueWindowState.getAttrs()
29932994
: null;
29942995

2995-
// If we are not currently showing a dream, then update the lockscreen
2996-
// state that will apply if a dream is shown next time.
2996+
// If we are not currently showing a dream then remember the current
2997+
// lockscreen state. We will use this to determine whether the dream
2998+
// started while the lockscreen was showing and remember this state
2999+
// while the dream is showing.
29973000
if (!mShowingDream) {
29983001
mDreamingLockscreen = mShowingLockscreen;
29993002
}

0 commit comments

Comments
 (0)