diff options
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java | 6 | ||||
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java index 96efeeb0c5eb..84840139d1a3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayLayout.java @@ -96,8 +96,7 @@ public class DisplayLayout { /** * Different from {@link #equals(Object)}, this method compares the basic geometry properties - * of two {@link DisplayLayout} objects including width, height, rotation, density, cutout and - * insets. + * of two {@link DisplayLayout} objects including width, height, rotation, density, cutout. * @return {@code true} if the given {@link DisplayLayout} is identical geometry wise. */ public boolean isSameGeometry(@NonNull DisplayLayout other) { @@ -105,8 +104,7 @@ public class DisplayLayout { && mHeight == other.mHeight && mRotation == other.mRotation && mDensityDpi == other.mDensityDpi - && Objects.equals(mCutout, other.mCutout) - && Objects.equals(mStableInsets, other.mStableInsets); + && Objects.equals(mCutout, other.mCutout); } @Override diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index 3153313de42f..c9613abf6c44 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -46,8 +46,6 @@ import android.content.res.Configuration; import android.graphics.Rect; import android.os.RemoteException; import android.os.SystemProperties; -import android.os.UserHandle; -import android.os.UserManager; import android.util.Pair; import android.util.Size; import android.view.DisplayInfo; @@ -618,7 +616,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb return; } int oldMaxMovementBound = mPipBoundsState.getMovementBounds().bottom; - onDisplayChanged( + onDisplayChangedUncheck( mDisplayController.getDisplayLayout(mPipBoundsState.getDisplayId()), false /* saveRestoreSnapFraction */); int newMaxMovementBound = mPipBoundsState.getMovementBounds().bottom; @@ -704,9 +702,12 @@ public class PipController implements PipTransitionController.PipTransitionCallb } private void onDisplayChanged(DisplayLayout layout, boolean saveRestoreSnapFraction) { - if (mPipBoundsState.getDisplayLayout().isSameGeometry(layout)) { - return; + if (!mPipBoundsState.getDisplayLayout().isSameGeometry(layout)) { + onDisplayChangedUncheck(layout, saveRestoreSnapFraction); } + } + + private void onDisplayChangedUncheck(DisplayLayout layout, boolean saveRestoreSnapFraction) { Runnable updateDisplayLayout = () -> { final boolean fromRotation = Transitions.ENABLE_SHELL_TRANSITIONS && mPipBoundsState.getDisplayLayout().rotation() != layout.rotation(); |