@@ -167,6 +167,7 @@ public class WindowManagerService extends IWindowManager.Stub
167167 static final boolean DEBUG_DRAG = false ;
168168 static final boolean DEBUG_SCREEN_ON = false ;
169169 static final boolean DEBUG_SCREENSHOT = false ;
170+ static final boolean DEBUG_BOOT = false ;
170171 static final boolean SHOW_SURFACE_ALLOC = false ;
171172 static final boolean SHOW_TRANSACTIONS = false ;
172173 static final boolean SHOW_LIGHT_TRANSACTIONS = false || SHOW_TRANSACTIONS ;
@@ -4728,6 +4729,14 @@ public int[] getInputDeviceIds() {
47284729
47294730 public void enableScreenAfterBoot () {
47304731 synchronized (mWindowMap ) {
4732+ if (DEBUG_BOOT ) {
4733+ RuntimeException here = new RuntimeException ("here" );
4734+ here .fillInStackTrace ();
4735+ Slog .i (TAG , "enableScreenAfterBoot: mDisplayEnabled=" + mDisplayEnabled
4736+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
4737+ + " mShowingBootMessages=" + mShowingBootMessages
4738+ + " mSystemBooted=" + mSystemBooted , here );
4739+ }
47314740 if (mSystemBooted ) {
47324741 return ;
47334742 }
@@ -4745,6 +4754,14 @@ public void enableScreenAfterBoot() {
47454754 }
47464755
47474756 void enableScreenIfNeededLocked () {
4757+ if (DEBUG_BOOT ) {
4758+ RuntimeException here = new RuntimeException ("here" );
4759+ here .fillInStackTrace ();
4760+ Slog .i (TAG , "enableScreenIfNeededLocked: mDisplayEnabled=" + mDisplayEnabled
4761+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
4762+ + " mShowingBootMessages=" + mShowingBootMessages
4763+ + " mSystemBooted=" + mSystemBooted , here );
4764+ }
47484765 if (mDisplayEnabled ) {
47494766 return ;
47504767 }
@@ -4767,6 +4784,14 @@ public void performBootTimeout() {
47674784
47684785 public void performEnableScreen () {
47694786 synchronized (mWindowMap ) {
4787+ if (DEBUG_BOOT ) {
4788+ RuntimeException here = new RuntimeException ("here" );
4789+ here .fillInStackTrace ();
4790+ Slog .i (TAG , "performEnableScreen: mDisplayEnabled=" + mDisplayEnabled
4791+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
4792+ + " mShowingBootMessages=" + mShowingBootMessages
4793+ + " mSystemBooted=" + mSystemBooted , here );
4794+ }
47704795 if (mDisplayEnabled ) {
47714796 return ;
47724797 }
@@ -4780,10 +4805,22 @@ public void performEnableScreen() {
47804805 boolean haveBootMsg = false ;
47814806 boolean haveApp = false ;
47824807 boolean haveWallpaper = false ;
4783- boolean haveKeyguard = false ;
4808+ boolean haveKeyguard = true ;
47844809 final int N = mWindows .size ();
47854810 for (int i =0 ; i <N ; i ++) {
47864811 WindowState w = mWindows .get (i );
4812+ if (w .mAttrs .type == WindowManager .LayoutParams .TYPE_KEYGUARD ) {
4813+ // Only if there is a keyguard attached to the window manager
4814+ // will we consider ourselves as having a keyguard. If it
4815+ // isn't attached, we don't know if it wants to be shown or
4816+ // hidden. If it is attached, we will say we have a keyguard
4817+ // if the window doesn't want to be visible, because in that
4818+ // case it explicitly doesn't want to be shown so we should
4819+ // not delay turning the screen on for it.
4820+ boolean vis = w .mViewVisibility == View .VISIBLE
4821+ && w .mPolicyVisibility ;
4822+ haveKeyguard = !vis ;
4823+ }
47874824 if (w .isVisibleLw () && !w .mObscured && !w .isDrawnLw ()) {
47884825 return ;
47894826 }
@@ -4800,7 +4837,7 @@ public void performEnableScreen() {
48004837 }
48014838 }
48024839
4803- if (DEBUG_SCREEN_ON ) {
4840+ if (DEBUG_SCREEN_ON || DEBUG_BOOT ) {
48044841 Slog .i (TAG , "******** booted=" + mSystemBooted + " msg=" + mShowingBootMessages
48054842 + " haveBoot=" + haveBootMsg + " haveApp=" + haveApp
48064843 + " haveWall=" + haveWallpaper + " haveKeyguard=" + haveKeyguard );
@@ -4821,7 +4858,7 @@ public void performEnableScreen() {
48214858 }
48224859
48234860 mDisplayEnabled = true ;
4824- if (DEBUG_SCREEN_ON ) Slog .i (TAG , "******************** ENABLING SCREEN!" );
4861+ if (DEBUG_SCREEN_ON || DEBUG_BOOT ) Slog .i (TAG , "******************** ENABLING SCREEN!" );
48254862 if (false ) {
48264863 StringWriter sw = new StringWriter ();
48274864 PrintWriter pw = new PrintWriter (sw );
@@ -4852,6 +4889,14 @@ public void performEnableScreen() {
48524889 public void showBootMessage (final CharSequence msg , final boolean always ) {
48534890 boolean first = false ;
48544891 synchronized (mWindowMap ) {
4892+ if (DEBUG_BOOT ) {
4893+ RuntimeException here = new RuntimeException ("here" );
4894+ here .fillInStackTrace ();
4895+ Slog .i (TAG , "showBootMessage: msg=" + msg + " always=" + always
4896+ + " mAllowBootMessages=" + mAllowBootMessages
4897+ + " mShowingBootMessages=" + mShowingBootMessages
4898+ + " mSystemBooted=" + mSystemBooted , here );
4899+ }
48554900 if (!mAllowBootMessages ) {
48564901 return ;
48574902 }
@@ -4873,6 +4918,14 @@ public void showBootMessage(final CharSequence msg, final boolean always) {
48734918 }
48744919
48754920 public void hideBootMessagesLocked () {
4921+ if (DEBUG_BOOT ) {
4922+ RuntimeException here = new RuntimeException ("here" );
4923+ here .fillInStackTrace ();
4924+ Slog .i (TAG , "hideBootMessagesLocked: mDisplayEnabled=" + mDisplayEnabled
4925+ + " mForceDisplayEnabled=" + mForceDisplayEnabled
4926+ + " mShowingBootMessages=" + mShowingBootMessages
4927+ + " mSystemBooted=" + mSystemBooted , here );
4928+ }
48764929 if (mShowingBootMessages ) {
48774930 mShowingBootMessages = false ;
48784931 mPolicy .hideBootMessages ();
0 commit comments