@@ -413,7 +413,9 @@ public void onInputEvent(InputEvent event) {
413413 boolean mForceStatusBarFromKeyguard ;
414414 boolean mHideLockScreen ;
415415 boolean mDismissKeyguard ;
416- boolean mNoDreamEnterAnim ;
416+ boolean mShowingLockscreen ;
417+ boolean mShowingDream ;
418+ boolean mDreamingLockscreen ;
417419 boolean mHomePressed ;
418420 boolean mHomeLongPressed ;
419421 Intent mHomeIntent ;
@@ -1726,7 +1728,7 @@ public int selectAnimationLw(WindowState win, int transit) {
17261728 if (PRINT_ANIM ) Log .i (TAG , "**** STARTING EXIT" );
17271729 return com .android .internal .R .anim .app_starting_exit ;
17281730 }
1729- } else if (win .getAttrs ().type == TYPE_DREAM && mNoDreamEnterAnim
1731+ } else if (win .getAttrs ().type == TYPE_DREAM && mDreamingLockscreen
17301732 && transit == TRANSIT_ENTER ) {
17311733 // Special case: we are animating in a dream, while the keyguard
17321734 // is shown. We don't want an animation on the dream, because
@@ -2927,7 +2929,8 @@ public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) {
29272929 mHideLockScreen = false ;
29282930 mAllowLockscreenWhenOn = false ;
29292931 mDismissKeyguard = false ;
2930- mNoDreamEnterAnim = false ;
2932+ mShowingLockscreen = false ;
2933+ mShowingDream = false ;
29312934 }
29322935
29332936 /** {@inheritDoc} */
@@ -2945,18 +2948,24 @@ public void applyPostLayoutPolicyLw(WindowState win,
29452948 }
29462949 }
29472950 if (attrs .type == TYPE_KEYGUARD ) {
2948- mNoDreamEnterAnim = true ;
2951+ mShowingLockscreen = true ;
29492952 }
2950- if (((attrs .type >= FIRST_APPLICATION_WINDOW && attrs .type <= LAST_APPLICATION_WINDOW )
2951- || (attrs .type == TYPE_DREAM && win .isVisibleLw ()))
2953+ boolean applyWindow = attrs .type >= FIRST_APPLICATION_WINDOW
2954+ && attrs .type <= LAST_APPLICATION_WINDOW ;
2955+ if (attrs .type == TYPE_DREAM ) {
2956+ mShowingDream = true ;
2957+ if (!mDreamingLockscreen ) {
2958+ applyWindow = true ;
2959+ } else if (win .isVisibleLw () && win .hasDrawnLw ()) {
2960+ applyWindow = true ;
2961+ }
2962+ }
2963+ if (applyWindow
29522964 && attrs .x == 0 && attrs .y == 0
29532965 && attrs .width == WindowManager .LayoutParams .MATCH_PARENT
29542966 && attrs .height == WindowManager .LayoutParams .MATCH_PARENT ) {
29552967 if (DEBUG_LAYOUT ) Log .v (TAG , "Fullscreen window: " + win );
29562968 mTopFullscreenOpaqueWindowState = win ;
2957- if (attrs .type == TYPE_DREAM ) {
2958- mForceStatusBarFromKeyguard = true ;
2959- }
29602969 if ((attrs .flags & FLAG_SHOW_WHEN_LOCKED ) != 0 ) {
29612970 if (DEBUG_LAYOUT ) Log .v (TAG , "Setting mHideLockScreen to true by win " + win );
29622971 mHideLockScreen = true ;
@@ -2983,6 +2992,12 @@ public int finishPostLayoutPolicyLw() {
29832992 ? mTopFullscreenOpaqueWindowState .getAttrs ()
29842993 : null ;
29852994
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.
2997+ if (!mShowingDream ) {
2998+ mDreamingLockscreen = mShowingLockscreen ;
2999+ }
3000+
29863001 if (mStatusBar != null ) {
29873002 if (DEBUG_LAYOUT ) Log .i (TAG , "force=" + mForceStatusBar
29883003 + " forcefkg=" + mForceStatusBarFromKeyguard
@@ -4523,9 +4538,12 @@ public void dump(String prefix, PrintWriter pw, String[] args) {
45234538 pw .print ("," ); pw .print (mDockBottom ); pw .println (")" );
45244539 pw .print (prefix ); pw .print ("mDockLayer=" ); pw .print (mDockLayer );
45254540 pw .print (" mStatusBarLayer=" ); pw .println (mStatusBarLayer );
4541+ pw .print (prefix ); pw .print ("mShowingLockscreen=" ); pw .print (mShowingLockscreen );
4542+ pw .print (" mShowingDream=" ); pw .print (mShowingDream );
4543+ pw .print (" mDreamingLockscreen=" ); pw .println (mDreamingLockscreen );
45264544 pw .print (prefix ); pw .print ("mTopFullscreenOpaqueWindowState=" );
45274545 pw .println (mTopFullscreenOpaqueWindowState );
4528- pw .print (prefix ); pw .print ("mTopIsFullscreen=" ); pw .print (mTopIsFullscreen );
4546+ pw .print (prefix ); pw .print ("mTopIsFullscreen=" ); pw .print (mTopIsFullscreen );
45294547 pw .print (" mHideLockScreen=" ); pw .println (mHideLockScreen );
45304548 pw .print (prefix ); pw .print ("mForceStatusBar=" ); pw .print (mForceStatusBar );
45314549 pw .print (" mForceStatusBarFromKeyguard=" );
0 commit comments