diff options
| author | 2020-08-20 19:52:19 +0200 | |
|---|---|---|
| committer | 2020-08-20 19:52:19 +0200 | |
| commit | d35999a92b685d0df8c67ac7f7eb3fe304b0f94c (patch) | |
| tree | 7bcd6e3321826d54e0d992b4fb434423b13fdb4d | |
| parent | f8a142cb58e38752d5c2c42435c6c5ed7d7edbe5 (diff) | |
Make the PipManager remember custom aspect ratios
Currently, the PipManager always reverts any pip window to the
preconfigured default size and position after any movement (e.g. pip
menu dismissal, or keyboard dismissal).
This does not take into account that a specific aspect ratio might have
been set in the PictureInPictureParams.
This change leverages the already correct calculation from the
PipBoundsHandler to update the default and current pip bounds kept by
the PipManager.
Bug: 163787014
Test: atest CtsSystemUiTestCases:BasicPipTests
Change-Id: I74829d95bc3ef06e6962020d5a56998128ec3640
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java index 0531ca195f95..db3660ece58c 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java +++ b/packages/SystemUI/src/com/android/systemui/pip/tv/PipManager.java @@ -141,7 +141,6 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio // Used to calculate the movement bounds private final DisplayInfo mTmpDisplayInfo = new DisplayInfo(); private final Rect mTmpInsetBounds = new Rect(); - private final Rect mTmpNormalBounds = new Rect(); // Keeps track of the IME visibility to adjust the PiP when the IME is visible private boolean mImeVisible; @@ -215,10 +214,8 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio public void onMovementBoundsChanged(boolean fromImeAdjustment) { mHandler.post(() -> { // Populate the inset / normal bounds and DisplayInfo from mPipBoundsHandler first. - final Rect destinationBounds = new Rect(); - mPipBoundsHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds, - destinationBounds, mTmpDisplayInfo); - mDefaultPipBounds.set(destinationBounds); + mPipBoundsHandler.onMovementBoundsChanged(mTmpInsetBounds, mPipBounds, + mDefaultPipBounds, mTmpDisplayInfo); }); } |