Replace mPendingRemove with hierarchy deferred removal
To eliminate the global list and simplify the path of surface placement. Bug: 163976519 Test: CtsActivityManagerDeviceTestCases Change-Id: I801606acf4689a4c950e5d21ffe1e4894fe855f9
This commit is contained in:
@@ -983,29 +983,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|
|||||||
mWmService.checkDrawnWindowsLocked();
|
mWmService.checkDrawnWindowsLocked();
|
||||||
}
|
}
|
||||||
|
|
||||||
final int N = mWmService.mPendingRemove.size();
|
|
||||||
if (N > 0) {
|
|
||||||
if (mWmService.mPendingRemoveTmp.length < N) {
|
|
||||||
mWmService.mPendingRemoveTmp = new WindowState[N + 10];
|
|
||||||
}
|
|
||||||
mWmService.mPendingRemove.toArray(mWmService.mPendingRemoveTmp);
|
|
||||||
mWmService.mPendingRemove.clear();
|
|
||||||
ArrayList<DisplayContent> displayList = new ArrayList();
|
|
||||||
for (i = 0; i < N; i++) {
|
|
||||||
final WindowState w = mWmService.mPendingRemoveTmp[i];
|
|
||||||
w.removeImmediately();
|
|
||||||
final DisplayContent displayContent = w.getDisplayContent();
|
|
||||||
if (displayContent != null && !displayList.contains(displayContent)) {
|
|
||||||
displayList.add(displayContent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int j = displayList.size() - 1; j >= 0; --j) {
|
|
||||||
final DisplayContent dc = displayList.get(j);
|
|
||||||
dc.assignWindowLayers(true /*setLayoutNeeded*/);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
forAllDisplays(dc -> {
|
forAllDisplays(dc -> {
|
||||||
dc.getInputMonitor().updateInputWindowsLw(true /*force*/);
|
dc.getInputMonitor().updateInputWindowsLw(true /*force*/);
|
||||||
dc.updateSystemGestureExclusion();
|
dc.updateSystemGestureExclusion();
|
||||||
|
|||||||
@@ -221,7 +221,6 @@ import android.util.DisplayMetrics;
|
|||||||
import android.util.EventLog;
|
import android.util.EventLog;
|
||||||
import android.util.MergedConfiguration;
|
import android.util.MergedConfiguration;
|
||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
import android.util.SparseArray;
|
|
||||||
import android.util.SparseBooleanArray;
|
import android.util.SparseBooleanArray;
|
||||||
import android.util.TimeUtils;
|
import android.util.TimeUtils;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
@@ -586,20 +585,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
*/
|
*/
|
||||||
final ArrayList<WindowState> mResizingWindows = new ArrayList<>();
|
final ArrayList<WindowState> mResizingWindows = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
|
||||||
* Windows whose animations have ended and now must be removed.
|
|
||||||
*/
|
|
||||||
final ArrayList<WindowState> mPendingRemove = new ArrayList<>();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Used when processing mPendingRemove to avoid working on the original array.
|
|
||||||
*/
|
|
||||||
WindowState[] mPendingRemoveTmp = new WindowState[20];
|
|
||||||
|
|
||||||
// TODO: use WindowProcessController once go/wm-unified is done.
|
|
||||||
/** Mapping of process pids to configurations */
|
|
||||||
final SparseArray<Configuration> mProcessConfigurations = new SparseArray<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Windows whose surface should be destroyed.
|
* Windows whose surface should be destroyed.
|
||||||
*/
|
*/
|
||||||
@@ -2035,7 +2020,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
dc.mWinRemovedSinceNullFocus.add(win);
|
dc.mWinRemovedSinceNullFocus.add(win);
|
||||||
}
|
}
|
||||||
mEmbeddedWindowController.onWindowRemoved(win);
|
mEmbeddedWindowController.onWindowRemoved(win);
|
||||||
mPendingRemove.remove(win);
|
|
||||||
mResizingWindows.remove(win);
|
mResizingWindows.remove(win);
|
||||||
updateNonSystemOverlayWindowsVisibilityIfNeeded(win, false /* surfaceShown */);
|
updateNonSystemOverlayWindowsVisibilityIfNeeded(win, false /* surfaceShown */);
|
||||||
mWindowsChanged = true;
|
mWindowsChanged = true;
|
||||||
@@ -6352,23 +6336,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mPendingRemove.size() > 0) {
|
|
||||||
pw.println();
|
|
||||||
pw.println(" Remove pending for:");
|
|
||||||
for (int i=mPendingRemove.size()-1; i>=0; i--) {
|
|
||||||
WindowState w = mPendingRemove.get(i);
|
|
||||||
if (windows == null || windows.contains(w)) {
|
|
||||||
pw.print(" Remove #"); pw.print(i); pw.print(' ');
|
|
||||||
pw.print(w);
|
|
||||||
if (dumpAll) {
|
|
||||||
pw.println(":");
|
|
||||||
w.dump(pw, " ", true);
|
|
||||||
} else {
|
|
||||||
pw.println();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (mForceRemoves != null && mForceRemoves.size() > 0) {
|
if (mForceRemoves != null && mForceRemoves.size() > 0) {
|
||||||
pw.println();
|
pw.println();
|
||||||
pw.println(" Windows force removing:");
|
pw.println(" Windows force removing:");
|
||||||
|
|||||||
@@ -4831,15 +4831,20 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
|||||||
if (hasSurface) {
|
if (hasSurface) {
|
||||||
mWmService.mDestroySurface.add(this);
|
mWmService.mDestroySurface.add(this);
|
||||||
}
|
}
|
||||||
if (mRemoveOnExit) {
|
|
||||||
mWmService.mPendingRemove.add(this);
|
|
||||||
mRemoveOnExit = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
mAnimatingExit = false;
|
mAnimatingExit = false;
|
||||||
getDisplayContent().mWallpaperController.hideWallpapers(this);
|
getDisplayContent().mWallpaperController.hideWallpapers(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean handleCompleteDeferredRemoval() {
|
||||||
|
if (mRemoveOnExit) {
|
||||||
|
mRemoveOnExit = false;
|
||||||
|
removeImmediately();
|
||||||
|
}
|
||||||
|
return super.handleCompleteDeferredRemoval();
|
||||||
|
}
|
||||||
|
|
||||||
boolean clearAnimatingFlags() {
|
boolean clearAnimatingFlags() {
|
||||||
boolean didSomething = false;
|
boolean didSomething = false;
|
||||||
// We don't want to clear it out for windows that get replaced, because the
|
// We don't want to clear it out for windows that get replaced, because the
|
||||||
|
|||||||
Reference in New Issue
Block a user