Merge "Fix window affecting SysUi visibility for once and all" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
6cfc8afa7a
@@ -400,6 +400,13 @@ public interface WindowManagerPolicy {
|
|||||||
*/
|
*/
|
||||||
boolean isAnimatingLw();
|
boolean isAnimatingLw();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Whether the window can affect SystemUI flags, meaning that SystemUI (system bars,
|
||||||
|
* for example) will be affected by the flags specified in this window. This is the
|
||||||
|
* case when the surface is on screen but not exiting.
|
||||||
|
*/
|
||||||
|
boolean canAffectSystemUiFlags();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is this window considered to be gone for purposes of layout?
|
* Is this window considered to be gone for purposes of layout?
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5333,11 +5333,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
@Override
|
@Override
|
||||||
public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs,
|
public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs,
|
||||||
WindowState attached, WindowState imeTarget) {
|
WindowState attached, WindowState imeTarget) {
|
||||||
final boolean visible = win.isVisibleLw() && win.getAttrs().alpha > 0f;
|
final boolean affectsSystemUi = win.canAffectSystemUiFlags();
|
||||||
if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisible=" + visible);
|
if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": affectsSystemUi=" + affectsSystemUi);
|
||||||
applyKeyguardPolicyLw(win, imeTarget);
|
applyKeyguardPolicyLw(win, imeTarget);
|
||||||
final int fl = PolicyControl.getWindowFlags(win, attrs);
|
final int fl = PolicyControl.getWindowFlags(win, attrs);
|
||||||
if (mTopFullscreenOpaqueWindowState == null && visible && attrs.type == TYPE_INPUT_METHOD) {
|
if (mTopFullscreenOpaqueWindowState == null && affectsSystemUi
|
||||||
|
&& attrs.type == TYPE_INPUT_METHOD) {
|
||||||
mForcingShowNavBar = true;
|
mForcingShowNavBar = true;
|
||||||
mForcingShowNavBarLayer = win.getSurfaceLayer();
|
mForcingShowNavBarLayer = win.getSurfaceLayer();
|
||||||
}
|
}
|
||||||
@@ -5353,7 +5354,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW
|
boolean appWindow = attrs.type >= FIRST_APPLICATION_WINDOW
|
||||||
&& attrs.type < FIRST_SYSTEM_WINDOW;
|
&& attrs.type < FIRST_SYSTEM_WINDOW;
|
||||||
final int stackId = win.getStackId();
|
final int stackId = win.getStackId();
|
||||||
if (mTopFullscreenOpaqueWindowState == null && visible) {
|
if (mTopFullscreenOpaqueWindowState == null && affectsSystemUi) {
|
||||||
if ((fl & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
|
if ((fl & FLAG_FORCE_NOT_FULLSCREEN) != 0) {
|
||||||
mForceStatusBar = true;
|
mForceStatusBar = true;
|
||||||
}
|
}
|
||||||
@@ -5385,7 +5386,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Voice interaction overrides both top fullscreen and top docked.
|
// Voice interaction overrides both top fullscreen and top docked.
|
||||||
if (visible && win.getAttrs().type == TYPE_VOICE_INTERACTION) {
|
if (affectsSystemUi && win.getAttrs().type == TYPE_VOICE_INTERACTION) {
|
||||||
if (mTopFullscreenOpaqueWindowState == null) {
|
if (mTopFullscreenOpaqueWindowState == null) {
|
||||||
mTopFullscreenOpaqueWindowState = win;
|
mTopFullscreenOpaqueWindowState = win;
|
||||||
if (mTopFullscreenOpaqueOrDimmingWindowState == null) {
|
if (mTopFullscreenOpaqueOrDimmingWindowState == null) {
|
||||||
@@ -5401,7 +5402,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Keep track of the window if it's dimming but not necessarily fullscreen.
|
// Keep track of the window if it's dimming but not necessarily fullscreen.
|
||||||
if (mTopFullscreenOpaqueOrDimmingWindowState == null && visible
|
if (mTopFullscreenOpaqueOrDimmingWindowState == null && affectsSystemUi
|
||||||
&& win.isDimming() && StackId.normallyFullscreenWindows(stackId)) {
|
&& win.isDimming() && StackId.normallyFullscreenWindows(stackId)) {
|
||||||
mTopFullscreenOpaqueOrDimmingWindowState = win;
|
mTopFullscreenOpaqueOrDimmingWindowState = win;
|
||||||
}
|
}
|
||||||
@@ -5409,7 +5410,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
// We need to keep track of the top "fullscreen" opaque window for the docked stack
|
// We need to keep track of the top "fullscreen" opaque window for the docked stack
|
||||||
// separately, because both the "real fullscreen" opaque window and the one for the docked
|
// separately, because both the "real fullscreen" opaque window and the one for the docked
|
||||||
// stack can control View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.
|
// stack can control View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.
|
||||||
if (mTopDockedOpaqueWindowState == null && visible && appWindow && attached == null
|
if (mTopDockedOpaqueWindowState == null && affectsSystemUi && appWindow && attached == null
|
||||||
&& isFullscreen(attrs) && stackId == DOCKED_STACK_ID) {
|
&& isFullscreen(attrs) && stackId == DOCKED_STACK_ID) {
|
||||||
mTopDockedOpaqueWindowState = win;
|
mTopDockedOpaqueWindowState = win;
|
||||||
if (mTopDockedOpaqueOrDimmingWindowState == null) {
|
if (mTopDockedOpaqueOrDimmingWindowState == null) {
|
||||||
@@ -5419,7 +5420,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
|
|
||||||
// Also keep track of any windows that are dimming but not necessarily fullscreen in the
|
// Also keep track of any windows that are dimming but not necessarily fullscreen in the
|
||||||
// docked stack.
|
// docked stack.
|
||||||
if (mTopDockedOpaqueOrDimmingWindowState == null && visible && win.isDimming()
|
if (mTopDockedOpaqueOrDimmingWindowState == null && affectsSystemUi && win.isDimming()
|
||||||
&& stackId == DOCKED_STACK_ID) {
|
&& stackId == DOCKED_STACK_ID) {
|
||||||
mTopDockedOpaqueOrDimmingWindowState = win;
|
mTopDockedOpaqueOrDimmingWindowState = win;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1403,6 +1403,16 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
|| ((mAppToken != null) && (mAppToken.mAppAnimator.animation != null)));
|
|| ((mAppToken != null) && (mAppToken.mAppAnimator.animation != null)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Another visibility method that was added late in the release to minimize risk.
|
||||||
|
@Override
|
||||||
|
public boolean canAffectSystemUiFlags() {
|
||||||
|
final boolean shown = mWinAnimator.getShown();
|
||||||
|
final boolean exiting = mAnimatingExit || mDestroying
|
||||||
|
|| mAppToken != null && mAppToken.hidden;
|
||||||
|
final boolean translucent = mAttrs.alpha == 0.0f;
|
||||||
|
return shown && !exiting && !translucent;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Like isOnScreen, but returns false if the surface hasn't yet
|
* Like isOnScreen, but returns false if the surface hasn't yet
|
||||||
* been drawn.
|
* been drawn.
|
||||||
|
|||||||
Reference in New Issue
Block a user