Align PIP menu after rotation

Moves the menu and updates its bounds to the post-rotation bounds.

Bug: 173252147
Test: enter Pip, tap to show menu, rotate - verify menu moves with
the Pip window

Change-Id: I19f33d256be6d6d7612cdfafcf0cae9c3620cb25
This commit is contained in:
jorgegil@google.com
2021-02-16 11:05:15 -08:00
parent a997c886e3
commit 52dd2fa170
2 changed files with 3 additions and 2 deletions

View File

@@ -66,7 +66,6 @@ import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.legacysplitscreen.LegacySplitScreen;
import com.android.wm.shell.legacysplitscreen.LegacySplitScreenController;
import com.android.wm.shell.pip.phone.PipMotionHelper;
import com.android.wm.shell.transition.Transitions;
@@ -973,7 +972,8 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
finishResizeForMenu(destinationBounds);
}
private void finishResizeForMenu(Rect destinationBounds) {
/** Moves the PiP menu to the destination bounds. */
public void finishResizeForMenu(Rect destinationBounds) {
mPipMenuController.movePipMenu(null, null, destinationBounds);
mPipMenuController.updateMenuBounds(destinationBounds);
}

View File

@@ -552,6 +552,7 @@ public class PipController implements PipTransitionController.PipTransitionCallb
// mTouchHandler would rely on the bounds populated from mPipTaskOrganizer
mPipTaskOrganizer.onMovementBoundsChanged(outBounds, fromRotation, fromImeAdjustment,
fromShelfAdjustment, wct);
mPipTaskOrganizer.finishResizeForMenu(outBounds);
mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mPipBoundsState.getNormalBounds(),
outBounds, fromImeAdjustment, fromShelfAdjustment, rotation);
}