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

Commit 3a4bb61a authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Change to use ConfigurationContainer.onParentChanged

Reduce duplicated code and also fix crash of WindowContainerTests
(testAddChildSetsSurfacePosition replaces the transaction factory)
by restoring the original surface transaction factory because the
WMS instance is shared.

Fixes: 123624626
Test: atest WindowContainerTests

Change-Id: Icf39aa074c2d91eda2ad07bd22e5ff751e48ba46
parent 195bafa1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -978,8 +978,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
    }

    @Override
    void onParentSet() {
        super.onParentSet();
    void onParentChanged() {
        super.onParentChanged();

        final Task task = getTask();

+1 −1
Original line number Diff line number Diff line
@@ -532,7 +532,7 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
    /**
     * Must be called when new parent for the container was set.
     */
    protected void onParentChanged() {
    void onParentChanged() {
        final ConfigurationContainer parent = getParent();
        // Removing parent usually means that we've detached this entity to destroy it or to attach
        // to another parent. In both cases we don't need to update the configuration now.
+4 −4
Original line number Diff line number Diff line
@@ -4356,8 +4356,8 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
        }

        @Override
        void onParentSet() {
            super.onParentSet();
        void onParentChanged() {
            super.onParentChanged();
            if (getParent() != null) {
                mAppAnimationLayer = makeChildSurface(null)
                        .setName("animationLayer")
@@ -4612,10 +4612,10 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo
    }

    @Override
    void onParentSet() {
    void onParentChanged() {
        // Since we are the top of the SurfaceControl hierarchy here
        // we create the root surfaces explicitly rather than chaining
        // up as the default implementation in onParentSet does. So we
        // up as the default implementation in onParentChanged does. So we
        // explicitly do NOT call super here.
    }

+2 −2
Original line number Diff line number Diff line
@@ -252,8 +252,8 @@ class Task extends WindowContainer<AppWindowToken> implements ConfigurationConta
    }

    @Override
    void onParentSet() {
        super.onParentSet();
    void onParentChanged() {
        super.onParentChanged();

        // Update task bounds if needed.
        adjustBoundsForDisplayChangeIfNeeded(getDisplayContent());
+2 −2
Original line number Diff line number Diff line
@@ -996,8 +996,8 @@ public class TaskStack extends WindowContainer<Task> implements
    }

    @Override
    void onParentSet() {
        super.onParentSet();
    void onParentChanged() {
        super.onParentChanged();

        if (getParent() != null || mDisplayContent == null) {
            return;
Loading