Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -341,7 +341,6 @@ public class PipController implements ConfigurationChangeListener, return; return; } } final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mPipBoundsState.getBounds()); final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mPipBoundsState.getBounds()); final float boundsScale = mPipBoundsState.getBoundsScale(); // Update the display layout caches even if we are not in PiP. // Update the display layout caches even if we are not in PiP. setDisplayLayout(mDisplayController.getDisplayLayout(displayId)); setDisplayLayout(mDisplayController.getDisplayLayout(displayId)); Loading @@ -368,6 +367,10 @@ public class PipController implements ConfigurationChangeListener, mPipTouchHandler.updateMovementBounds(); mPipTouchHandler.updateMovementBounds(); mPipTransitionState.setInFixedRotation(false); mPipTransitionState.setInFixedRotation(false); } else { } else { final float boundsScale = mPipBoundsState.getBoundsScale(); // Before calculating the PiP bounds, the PiP minimum and maximum sizes // need to be recalculated for the current display. mPipBoundsState.updateMinMaxSize(mPipBoundsState.getAspectRatio()); Rect toBounds = new Rect(0, 0, Rect toBounds = new Rect(0, 0, (int) Math.ceil(mPipBoundsState.getMaxSize().x * boundsScale), (int) Math.ceil(mPipBoundsState.getMaxSize().x * boundsScale), (int) Math.ceil(mPipBoundsState.getMaxSize().y * boundsScale)); (int) Math.ceil(mPipBoundsState.getMaxSize().y * boundsScale)); Loading @@ -378,6 +381,7 @@ public class PipController implements ConfigurationChangeListener, // The policy is to keep PiP snap fraction invariant. // The policy is to keep PiP snap fraction invariant. mPipBoundsAlgorithm.applySnapFraction(toBounds, snapFraction); mPipBoundsAlgorithm.applySnapFraction(toBounds, snapFraction); mPipBoundsState.setBounds(toBounds); mPipBoundsState.setBounds(toBounds); mPipTouchHandler.setUserResizeBounds(toBounds); } } if (mPipTransitionState.getPipTaskToken() == null) { if (mPipTransitionState.getPipTaskToken() == null) { Log.d(TAG, "PipController.onDisplayChange no PiP task token" Log.d(TAG, "PipController.onDisplayChange no PiP task token" Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -341,7 +341,6 @@ public class PipController implements ConfigurationChangeListener, return; return; } } final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mPipBoundsState.getBounds()); final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mPipBoundsState.getBounds()); final float boundsScale = mPipBoundsState.getBoundsScale(); // Update the display layout caches even if we are not in PiP. // Update the display layout caches even if we are not in PiP. setDisplayLayout(mDisplayController.getDisplayLayout(displayId)); setDisplayLayout(mDisplayController.getDisplayLayout(displayId)); Loading @@ -368,6 +367,10 @@ public class PipController implements ConfigurationChangeListener, mPipTouchHandler.updateMovementBounds(); mPipTouchHandler.updateMovementBounds(); mPipTransitionState.setInFixedRotation(false); mPipTransitionState.setInFixedRotation(false); } else { } else { final float boundsScale = mPipBoundsState.getBoundsScale(); // Before calculating the PiP bounds, the PiP minimum and maximum sizes // need to be recalculated for the current display. mPipBoundsState.updateMinMaxSize(mPipBoundsState.getAspectRatio()); Rect toBounds = new Rect(0, 0, Rect toBounds = new Rect(0, 0, (int) Math.ceil(mPipBoundsState.getMaxSize().x * boundsScale), (int) Math.ceil(mPipBoundsState.getMaxSize().x * boundsScale), (int) Math.ceil(mPipBoundsState.getMaxSize().y * boundsScale)); (int) Math.ceil(mPipBoundsState.getMaxSize().y * boundsScale)); Loading @@ -378,6 +381,7 @@ public class PipController implements ConfigurationChangeListener, // The policy is to keep PiP snap fraction invariant. // The policy is to keep PiP snap fraction invariant. mPipBoundsAlgorithm.applySnapFraction(toBounds, snapFraction); mPipBoundsAlgorithm.applySnapFraction(toBounds, snapFraction); mPipBoundsState.setBounds(toBounds); mPipBoundsState.setBounds(toBounds); mPipTouchHandler.setUserResizeBounds(toBounds); } } if (mPipTransitionState.getPipTaskToken() == null) { if (mPipTransitionState.getPipTaskToken() == null) { Log.d(TAG, "PipController.onDisplayChange no PiP task token" Log.d(TAG, "PipController.onDisplayChange no PiP task token" Loading