Replace DimLayers with windows.
When replacing windows seamlessly we should also replace their DimLayers. Bug: 26668339 Change-Id: I44d8dbacf1b2213cfb882a40a1c878666a1ebef0
This commit is contained in:
@@ -169,6 +169,10 @@ class DimLayerController {
|
||||
+ " dimLayerUser=" + dimLayerUser.toShortString()
|
||||
+ " state.continueDimming=" + state.continueDimming
|
||||
+ " state.dimLayer.isDimming=" + state.dimLayer.isDimming());
|
||||
if (state.animator != null && state.animator.mWin.mWillReplaceWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!state.continueDimming && state.dimLayer.isDimming()) {
|
||||
state.animator = null;
|
||||
dimLayerUser.getDimBounds(mTmpBounds);
|
||||
@@ -303,7 +307,7 @@ class DimLayerController {
|
||||
applyDim(dimLayerUser, animator, true /* aboveApp */);
|
||||
}
|
||||
|
||||
private void applyDim(
|
||||
void applyDim(
|
||||
DimLayer.DimLayerUser dimLayerUser, WindowStateAnimator animator, boolean aboveApp) {
|
||||
if (dimLayerUser == null) {
|
||||
Slog.e(TAG, "Trying to apply dim layer for: " + this
|
||||
|
||||
@@ -1554,7 +1554,7 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
// If app died visible, apply a dim over the window to indicate that it's inactive
|
||||
mDisplayContent.mDimLayerController.applyDimAbove(getDimLayerUser(), mWinAnimator);
|
||||
} else if ((mAttrs.flags & FLAG_DIM_BEHIND) != 0
|
||||
&& mDisplayContent != null && !mAnimatingExit && isDisplayedLw()) {
|
||||
&& mDisplayContent != null && !mAnimatingExit && isVisibleUnchecked()) {
|
||||
mDisplayContent.mDimLayerController.applyDimBehind(getDimLayerUser(), mWinAnimator);
|
||||
}
|
||||
}
|
||||
@@ -1575,6 +1575,9 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
final WindowState win = mAppToken.allAppWindows.get(i);
|
||||
if (win.mWillReplaceWindow && win.mReplacingWindow == this && hasDrawnLw()) {
|
||||
if (DEBUG_ADD_REMOVE) Slog.d(TAG, "Removing replaced window: " + win);
|
||||
if (win.isDimming()) {
|
||||
win.transferDimToReplacement();
|
||||
}
|
||||
win.mWillReplaceWindow = false;
|
||||
win.mAnimateReplacingWindow = false;
|
||||
win.mReplacingRemoveRequested = false;
|
||||
@@ -2712,6 +2715,15 @@ final class WindowState implements WindowManagerPolicy.WindowState {
|
||||
return winY;
|
||||
}
|
||||
|
||||
void transferDimToReplacement() {
|
||||
final DimLayer.DimLayerUser dimLayerUser = getDimLayerUser();
|
||||
if (dimLayerUser != null && mDisplayContent != null) {
|
||||
mDisplayContent.mDimLayerController.applyDim(dimLayerUser,
|
||||
mReplacingWindow.mWinAnimator,
|
||||
(mAttrs.flags & FLAG_DIM_BEHIND) != 0 ? true : false);
|
||||
}
|
||||
}
|
||||
|
||||
// During activity relaunch due to resize, we sometimes use window replacement
|
||||
// for only child windows (as the main window is handled by window preservation)
|
||||
// and the big surface.
|
||||
|
||||
Reference in New Issue
Block a user