2121import static android .view .WindowManager .LayoutParams .LAST_SUB_WINDOW ;
2222import static android .view .WindowManager .LayoutParams .TYPE_INPUT_METHOD ;
2323import static android .view .WindowManager .LayoutParams .TYPE_INPUT_METHOD_DIALOG ;
24+ import static android .view .WindowManager .LayoutParams .TYPE_KEYGUARD ;
2425import static android .view .WindowManager .LayoutParams .TYPE_WALLPAPER ;
2526
2627import com .android .server .input .InputWindowHandle ;
@@ -112,6 +113,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
112113 int mLayoutSeq = -1 ;
113114
114115 Configuration mConfiguration = null ;
116+ // Sticky answer to isConfigChanged(), remains true until new Configuration is assigned.
117+ // Used only on {@link #TYPE_KEYGUARD}.
118+ private boolean mConfigHasChanged ;
115119
116120 /**
117121 * Actual frame shown on-screen (may be modified by animation). These
@@ -627,6 +631,7 @@ public long getInputDispatchingTimeoutNanos() {
627631 : WindowManagerService .DEFAULT_INPUT_DISPATCHING_TIMEOUT_NANOS ;
628632 }
629633
634+ @ Override
630635 public boolean hasAppShownWindows () {
631636 return mAppToken != null && (mAppToken .firstWindowDrawn || mAppToken .startingDisplayed );
632637 }
@@ -857,9 +862,17 @@ boolean isFullscreen(int screenWidth, int screenHeight) {
857862 }
858863
859864 boolean isConfigChanged () {
860- return mConfiguration != mService .mCurConfiguration
865+ boolean configChanged = mConfiguration != mService .mCurConfiguration
861866 && (mConfiguration == null
862867 || (mConfiguration .diff (mService .mCurConfiguration ) != 0 ));
868+
869+ if (mAttrs .type == TYPE_KEYGUARD ) {
870+ // Retain configuration changed status until resetConfiguration called.
871+ mConfigHasChanged |= configChanged ;
872+ configChanged = mConfigHasChanged ;
873+ }
874+
875+ return configChanged ;
863876 }
864877
865878 boolean isConfigDiff (int mask ) {
@@ -886,6 +899,11 @@ void removeLocked() {
886899 }
887900 }
888901
902+ void setConfiguration (final Configuration newConfig ) {
903+ mConfiguration = newConfig ;
904+ mConfigHasChanged = false ;
905+ }
906+
889907 void setInputChannel (InputChannel inputChannel ) {
890908 if (mInputChannel != null ) {
891909 throw new IllegalStateException ("Window already has an input channel." );
@@ -907,6 +925,7 @@ void disposeInputChannel() {
907925 }
908926
909927 private class DeathRecipient implements IBinder .DeathRecipient {
928+ @ Override
910929 public void binderDied () {
911930 try {
912931 synchronized (mService .mWindowMap ) {
0 commit comments