Merge "Remove DisplayContent#mExitingTokens and WindowToken#hasVisible"
This commit is contained in:
committed by
Android (Google) Code Review
commit
141bdcf58b
@@ -467,9 +467,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
@VisibleForTesting
|
||||
boolean isDefaultDisplay;
|
||||
|
||||
/** Window tokens that are in the process of exiting, but still on screen for animations. */
|
||||
final ArrayList<WindowToken> mExitingTokens = new ArrayList<>();
|
||||
|
||||
/** Detect user tapping outside of current focused task bounds .*/
|
||||
@VisibleForTesting
|
||||
final TaskTapPointerEventListener mTapDetector;
|
||||
@@ -3359,17 +3356,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
});
|
||||
|
||||
pw.println();
|
||||
if (!mExitingTokens.isEmpty()) {
|
||||
pw.println();
|
||||
pw.println(" Exiting tokens:");
|
||||
for (int i = mExitingTokens.size() - 1; i >= 0; i--) {
|
||||
final WindowToken token = mExitingTokens.get(i);
|
||||
pw.print(" Exiting #"); pw.print(i);
|
||||
pw.print(' '); pw.print(token);
|
||||
pw.println(':');
|
||||
token.dump(pw, " ", dumpAll);
|
||||
}
|
||||
}
|
||||
|
||||
final ScreenRotationAnimation rotationAnimation = getRotationAnimation();
|
||||
if (rotationAnimation != null) {
|
||||
@@ -4623,21 +4609,6 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
return ret;
|
||||
}
|
||||
|
||||
void setExitingTokensHasVisible(boolean hasVisible) {
|
||||
for (int i = mExitingTokens.size() - 1; i >= 0; i--) {
|
||||
mExitingTokens.get(i).hasVisible = hasVisible;
|
||||
}
|
||||
}
|
||||
|
||||
void removeExistingTokensIfPossible() {
|
||||
for (int i = mExitingTokens.size() - 1; i >= 0; i--) {
|
||||
final WindowToken token = mExitingTokens.get(i);
|
||||
if (!token.hasVisible) {
|
||||
mExitingTokens.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
void onDescendantOverrideConfigurationChanged() {
|
||||
setLayoutNeeded();
|
||||
|
||||
@@ -839,12 +839,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
UPDATE_FOCUS_WILL_PLACE_SURFACES, false /*updateInputWindows*/);
|
||||
}
|
||||
|
||||
// Initialize state of exiting tokens.
|
||||
for (int displayNdx = 0; displayNdx < mChildren.size(); ++displayNdx) {
|
||||
final DisplayContent displayContent = mChildren.get(displayNdx);
|
||||
displayContent.setExitingTokensHasVisible(false);
|
||||
}
|
||||
|
||||
mHoldScreen = null;
|
||||
mScreenBrightnessOverride = PowerManager.BRIGHTNESS_INVALID_FLOAT;
|
||||
mUserActivityTimeout = -1;
|
||||
@@ -951,12 +945,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
||||
mWmService.mDestroySurface.clear();
|
||||
}
|
||||
|
||||
// Time to remove any exiting tokens?
|
||||
for (int displayNdx = mChildren.size() - 1; displayNdx >= 0; --displayNdx) {
|
||||
final DisplayContent displayContent = mChildren.get(displayNdx);
|
||||
displayContent.removeExistingTokensIfPossible();
|
||||
}
|
||||
|
||||
for (int displayNdx = 0; displayNdx < mChildren.size(); ++displayNdx) {
|
||||
final DisplayContent displayContent = mChildren.get(displayNdx);
|
||||
if (displayContent.pendingLayoutChanges != 0) {
|
||||
|
||||
@@ -514,8 +514,6 @@ class WindowStateAnimator {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean displayed = false;
|
||||
|
||||
computeShownFrameLocked();
|
||||
|
||||
setSurfaceBoundariesLocked(t);
|
||||
@@ -535,7 +533,6 @@ class WindowStateAnimator {
|
||||
}
|
||||
} else if (mLastAlpha != mShownAlpha
|
||||
|| mLastHidden) {
|
||||
displayed = true;
|
||||
mLastAlpha = mShownAlpha;
|
||||
ProtoLog.i(WM_SHOW_TRANSACTIONS,
|
||||
"SURFACE controller=%s alpha=%f HScale=%f, VScale=%f: %s",
|
||||
@@ -566,14 +563,10 @@ class WindowStateAnimator {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasSurface()) {
|
||||
w.mToken.hasVisible = true;
|
||||
}
|
||||
} else {
|
||||
if (DEBUG_ANIM && mWin.isAnimating(TRANSITION | PARENTS)) {
|
||||
Slog.v(TAG, "prepareSurface: No changes in animation for " + this);
|
||||
}
|
||||
displayed = true;
|
||||
}
|
||||
|
||||
if (w.getOrientationChanging()) {
|
||||
@@ -589,10 +582,6 @@ class WindowStateAnimator {
|
||||
ProtoLog.v(WM_DEBUG_ORIENTATION, "Orientation change complete in %s", w);
|
||||
}
|
||||
}
|
||||
|
||||
if (displayed) {
|
||||
w.mToken.hasVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,8 +26,6 @@ import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
|
||||
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
|
||||
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_FOCUS;
|
||||
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_WINDOW_MOVEMENT;
|
||||
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
|
||||
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
|
||||
import static com.android.server.wm.WindowContainerChildProto.WINDOW_TOKEN;
|
||||
@@ -102,9 +100,6 @@ class WindowToken extends WindowContainer<WindowState> {
|
||||
// Is key dispatching paused for this token?
|
||||
boolean paused = false;
|
||||
|
||||
// Temporary for finding which tokens no longer have visible windows.
|
||||
boolean hasVisible;
|
||||
|
||||
// Set to true when this token is in a pending transaction where it
|
||||
// will be shown.
|
||||
boolean waitingToShow;
|
||||
@@ -240,6 +235,7 @@ class WindowToken extends WindowContainer<WindowState> {
|
||||
}
|
||||
}
|
||||
|
||||
/** Starts exit animation or hides windows if needed. It is only used for non-activity token. */
|
||||
void setExiting(boolean animateExit) {
|
||||
if (isEmpty()) {
|
||||
super.removeImmediately();
|
||||
@@ -255,27 +251,15 @@ class WindowToken extends WindowContainer<WindowState> {
|
||||
|
||||
final int count = mChildren.size();
|
||||
boolean changed = false;
|
||||
final boolean delayed = isAnimating(TRANSITION | PARENTS)
|
||||
|| (isAnimating(CHILDREN, ANIMATION_TYPE_WINDOW_ANIMATION) && animateExit);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
final WindowState win = mChildren.get(i);
|
||||
changed |= win.onSetAppExiting(animateExit);
|
||||
}
|
||||
|
||||
final ActivityRecord app = asActivityRecord();
|
||||
if (app != null) {
|
||||
app.setVisible(false);
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
mWmService.mWindowPlacerLocked.performSurfacePlacement();
|
||||
mWmService.updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL, false /*updateInputWindows*/);
|
||||
}
|
||||
|
||||
if (delayed) {
|
||||
mDisplayContent.mExitingTokens.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -723,7 +707,6 @@ class WindowToken extends WindowContainer<WindowState> {
|
||||
super.dump(pw, prefix, dumpAll);
|
||||
pw.print(prefix); pw.print("windows="); pw.println(mChildren);
|
||||
pw.print(prefix); pw.print("windowType="); pw.print(windowType);
|
||||
pw.print(" hasVisible="); pw.print(hasVisible);
|
||||
if (waitingToShow) {
|
||||
pw.print(" waitingToShow=true");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user