Merge "Ignore ui mode change caused by Morris overlay in PiP" into sc-v2-dev am: e5843059e7

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

Change-Id: If0fd575938f6c337bf1be160300d0a0e80777ecc
This commit is contained in:
TreeHugger Robot
2021-11-18 23:10:22 +00:00
committed by Automerger Merge Worker
2 changed files with 14 additions and 2 deletions

View File

@@ -93,6 +93,19 @@ public class DisplayLayout {
private boolean mReverseDefaultRotation = false; private boolean mReverseDefaultRotation = false;
private InsetsState mInsetsState = new InsetsState(); private InsetsState mInsetsState = new InsetsState();
/**
* 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;

View File

@@ -88,7 +88,6 @@ import com.android.wm.shell.pip.PipUtils;
import com.android.wm.shell.transition.Transitions; import com.android.wm.shell.transition.Transitions;
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;
@@ -469,7 +468,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 = () -> {