Merge "Fix the regression of PiP position in fixed rotation" into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d7f99f6c63
@@ -612,12 +612,21 @@ public class PipController implements PipTransitionController.PipTransitionCallb
|
|||||||
new DisplayInsetsController.OnInsetsChangedListener() {
|
new DisplayInsetsController.OnInsetsChangedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void insetsChanged(InsetsState insetsState) {
|
public void insetsChanged(InsetsState insetsState) {
|
||||||
|
DisplayLayout pendingLayout =
|
||||||
|
mDisplayController.getDisplayLayout(mPipBoundsState.getDisplayId());
|
||||||
|
if (mIsInFixedRotation
|
||||||
|
|| pendingLayout.rotation()
|
||||||
|
!= mPipBoundsState.getDisplayLayout().rotation()) {
|
||||||
|
// bail out if there is a pending rotation or fixed rotation change
|
||||||
|
return;
|
||||||
|
}
|
||||||
int oldMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
|
int oldMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
|
||||||
onDisplayChanged(
|
onDisplayChanged(
|
||||||
mDisplayController.getDisplayLayout(mPipBoundsState.getDisplayId()),
|
mDisplayController.getDisplayLayout(mPipBoundsState.getDisplayId()),
|
||||||
false /* saveRestoreSnapFraction */);
|
false /* saveRestoreSnapFraction */);
|
||||||
int newMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
|
int newMaxMovementBound = mPipBoundsState.getMovementBounds().bottom;
|
||||||
if (!mEnablePipKeepClearAlgorithm) {
|
if (!mEnablePipKeepClearAlgorithm) {
|
||||||
|
// offset PiP to adjust for bottom inset change
|
||||||
int pipTop = mPipBoundsState.getBounds().top;
|
int pipTop = mPipBoundsState.getBounds().top;
|
||||||
int diff = newMaxMovementBound - oldMaxMovementBound;
|
int diff = newMaxMovementBound - oldMaxMovementBound;
|
||||||
if (diff < 0 && pipTop > newMaxMovementBound) {
|
if (diff < 0 && pipTop > newMaxMovementBound) {
|
||||||
|
|||||||
Reference in New Issue
Block a user