Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bc47736 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Removed child windows from WindowToken window list

With the window container hierarchy model, containers should only
link to their direct children and delegate any operation on
decendants of their children to their children.

Bug: 30060889
Change-Id: I99ca0d181d54cfe75bbe24c1b0daaa06cf7cfd9a
parent b3847d8e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2464,7 +2464,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
            // entrance of the new window to be properly animated.
            // Note here we always set the replacing window first, as the flags might be needed
            // during the relaunch. If we end up not doing any relaunch, we clear the flags later.
            mWindowManager.setReplacingWindow(topActivity.appToken, animate);
            mWindowManager.setWillReplaceWindow(topActivity.appToken, animate);
        }

        mWindowManager.deferSurfaceLayout();
@@ -2506,7 +2506,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
            // If we didn't actual do a relaunch (indicated by kept==true meaning we kept the old
            // window), we need to clear the replace window settings. Otherwise, we schedule a
            // timeout to remove the old window if the replacing window is not coming in time.
            mWindowManager.scheduleClearReplacingWindowIfNeeded(topActivity.appToken, !kept);
            mWindowManager.scheduleClearWillReplaceWindows(topActivity.appToken, !kept);
        }

        if (!deferResume) {
+109 −342

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ final class Session extends IWindowSession.Stub

    @Override
    public void prepareToReplaceWindows(IBinder appToken, boolean childrenOnly) {
        mService.setReplacingWindows(appToken, childrenOnly);
        mService.setWillReplaceWindows(appToken, childrenOnly);
    }

    public int relayout(IWindow window, int seq, WindowManager.LayoutParams attrs,
+3 −12
Original line number Diff line number Diff line
@@ -17,18 +17,14 @@
package com.android.server.wm;

import static android.app.ActivityManager.RESIZE_MODE_SYSTEM_SCREEN_ROTATION;
import static android.app.ActivityManager.StackId.DOCKED_STACK_ID;
import static android.app.ActivityManager.StackId.PINNED_STACK_ID;
import static android.app.ActivityManager.StackId.FREEFORM_WORKSPACE_STACK_ID;
import static android.app.ActivityManager.StackId.HOME_STACK_ID;
import static android.content.pm.ActivityInfo.RESIZE_MODE_CROP_WINDOWS;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_RESIZE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_STACK;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.WindowManagerService.H.RESIZE_TASK;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;

import android.app.ActivityManager.StackId;
import android.content.pm.ActivityInfo;
@@ -44,7 +40,6 @@ import android.view.SurfaceControl;
import com.android.server.EventLogTags;

import java.io.PrintWriter;
import java.util.ArrayList;

class Task implements DimLayer.DimLayerUser {
    static final String TAG = TAG_WITH_CLASS_NAME ? "Task" : TAG_WM;
@@ -311,7 +306,7 @@ class Task implements DimLayer.DimLayerUser {
        if ((boundsChanged & BOUNDS_CHANGE_SIZE) == BOUNDS_CHANGE_SIZE) {
            resizeWindows();
        } else {
            moveWindows();
            setMovedByResize();
        }
        return true;
    }
@@ -545,9 +540,9 @@ class Task implements DimLayer.DimLayerUser {
        }
    }

    void moveWindows() {
    void setMovedByResize() {
        for (int i = mAppTokens.size() - 1; i >= 0; --i) {
            mAppTokens.get(i).moveWindows();
            mAppTokens.get(i).setMovedByResize();
        }
    }

@@ -616,10 +611,6 @@ class Task implements DimLayer.DimLayerUser {
        return null;
    }

    AppWindowToken getTopAppToken() {
        return mAppTokens.size() > 0 ? mAppTokens.get(mAppTokens.size() - 1) : null;
    }

    @Override
    public boolean dimFullscreen() {
        return isHomeTask() || isFullscreen();
+5 −0
Original line number Diff line number Diff line
@@ -91,4 +91,9 @@ class WindowContainer {
        }
        return false;
    }

    /** Returns the top child container or this container if there are no children. */
    WindowContainer getTop() {
        return mChildren.isEmpty() ? this : mChildren.peekLast();
    }
}
Loading