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

Commit 879f4e53 authored by Hongwei Wang's avatar Hongwei Wang Committed by Automerger Merge Worker
Browse files

Ignore ui mode change caused by Morris overlay in PiP am: 166f2631

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16372369

Change-Id: I27576af5a2bf75969c4e6ef292fbf11111fc66ce
parents fd77aa44 166f2631
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,19 @@ public class DisplayLayout {
    private boolean mHasStatusBar = false;
    private boolean mHasStatusBar = false;
    private int mNavBarFrameHeight = 0;
    private int mNavBarFrameHeight = 0;


    /**
     * Different from {@link #equals(Object)}, this method compares the basic geometry properties
     * of two {@link DisplayLayout} objects including width, height, rotation, density and cutout.
     * @return {@code true} if the given {@link DisplayLayout} is identical geometry wise.
     */
    public boolean isSameGeometry(@NonNull DisplayLayout other) {
        return mWidth == other.mWidth
                && mHeight == other.mHeight
                && mRotation == other.mRotation
                && mDensityDpi == other.mDensityDpi
                && Objects.equals(mCutout, other.mCutout);
    }

    @Override
    @Override
    public boolean equals(Object o) {
    public boolean equals(Object o) {
        if (this == o) return true;
        if (this == o) return true;
+1 −2
Original line number Original line Diff line number Diff line
@@ -76,7 +76,6 @@ import com.android.wm.shell.pip.PipTransitionController;
import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.pip.PipUtils;


import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.Optional;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Consumer;


@@ -441,7 +440,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
    }
    }


    private void onDisplayChanged(DisplayLayout layout, boolean saveRestoreSnapFraction) {
    private void onDisplayChanged(DisplayLayout layout, boolean saveRestoreSnapFraction) {
        if (Objects.equals(layout, mPipBoundsState.getDisplayLayout())) {
        if (mPipBoundsState.getDisplayLayout().isSameGeometry(layout)) {
            return;
            return;
        }
        }
        Runnable updateDisplayLayout = () -> {
        Runnable updateDisplayLayout = () -> {