Skip to content

Commit a3f4bf5

Browse files
author
Craig Mautner
committed
Always layout Keyguard on config change.
Add Keyguard to list of windows that can't be hidden by keyguard. Don't assign Configuration to window until layout has had a chance to compare it to window's existing Configuration. Bug: 7094175 Change-Id: I99a9fd4af9a31871fe130db7b6bdf49bd51a6092
1 parent 33387b1 commit a3f4bf5

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,16 +1473,24 @@ public int getConfigDisplayHeight(int fullWidth, int fullHeight, int rotation) {
14731473
return getNonDecorDisplayHeight(fullWidth, fullHeight, rotation);
14741474
}
14751475

1476+
@Override
14761477
public boolean doesForceHide(WindowState win, WindowManager.LayoutParams attrs) {
14771478
return attrs.type == WindowManager.LayoutParams.TYPE_KEYGUARD;
14781479
}
14791480

1481+
@Override
14801482
public boolean canBeForceHidden(WindowState win, WindowManager.LayoutParams attrs) {
1481-
return attrs.type != WindowManager.LayoutParams.TYPE_STATUS_BAR
1482-
&& attrs.type != WindowManager.LayoutParams.TYPE_NAVIGATION_BAR
1483-
&& attrs.type != WindowManager.LayoutParams.TYPE_WALLPAPER
1484-
&& attrs.type != WindowManager.LayoutParams.TYPE_DREAM
1485-
&& attrs.type != WindowManager.LayoutParams.TYPE_UNIVERSE_BACKGROUND;
1483+
switch (attrs.type) {
1484+
case TYPE_STATUS_BAR:
1485+
case TYPE_NAVIGATION_BAR:
1486+
case TYPE_WALLPAPER:
1487+
case TYPE_DREAM:
1488+
case TYPE_UNIVERSE_BACKGROUND:
1489+
case TYPE_KEYGUARD:
1490+
return false;
1491+
default:
1492+
return true;
1493+
}
14861494
}
14871495

14881496
/** {@inheritDoc} */

services/java/com/android/server/wm/WindowManagerService.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2823,16 +2823,9 @@ public int relayoutWindow(Session session, IWindow client, int seq,
28232823
"Relayout window turning screen on: " + win);
28242824
win.mTurnOnScreen = true;
28252825
}
2826-
int diff = 0;
2827-
if (win.mConfiguration != mCurConfiguration
2828-
&& (win.mConfiguration == null
2829-
|| (diff=mCurConfiguration.diff(win.mConfiguration)) != 0)) {
2830-
win.mConfiguration = mCurConfiguration;
2831-
if (DEBUG_CONFIGURATION) {
2832-
Slog.i(TAG, "Window " + win + " visible with new config: "
2833-
+ win.mConfiguration + " / 0x"
2834-
+ Integer.toHexString(diff));
2835-
}
2826+
if (win.isConfigChanged()) {
2827+
if (DEBUG_CONFIGURATION) Slog.i(TAG, "Window " + win
2828+
+ " visible with new config: " + win.mConfiguration);
28362829
outConfig.setTo(mCurConfiguration);
28372830
}
28382831
}
@@ -8260,7 +8253,7 @@ private final void performLayoutLockedInner(final DisplayContent displayContent,
82608253
Slog.v(TAG, "1ST PASS " + win
82618254
+ ": gone=" + gone + " mHaveFrame=" + win.mHaveFrame
82628255
+ " mLayoutAttached=" + win.mLayoutAttached
8263-
+ " screen changed=" + win.isConfigDiff(ActivityInfo.CONFIG_SCREEN_SIZE));
8256+
+ " screen changed=" + win.isConfigChanged());
82648257
final AppWindowToken atoken = win.mAppToken;
82658258
if (gone) Slog.v(TAG, " GONE: mViewVisibility="
82668259
+ win.mViewVisibility + " mRelayoutCalled="
@@ -8282,7 +8275,7 @@ private final void performLayoutLockedInner(final DisplayContent displayContent,
82828275
// windows, since that means "perform layout as normal,
82838276
// just don't display").
82848277
if (!gone || !win.mHaveFrame || win.mLayoutNeeded
8285-
|| win.isConfigDiff(ActivityInfo.CONFIG_SCREEN_SIZE)
8278+
|| win.isConfigChanged()
82868279
|| win.mAttrs.type == TYPE_UNIVERSE_BACKGROUND) {
82878280
if (!win.mLayoutAttached) {
82888281
if (initial) {

0 commit comments

Comments
 (0)