Merge "Fix unwanted PIP window dismissal when moving to the bottom" into pi-dev
diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java
index 31d8cbb..ad84130 100644
--- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java
@@ -225,9 +225,10 @@
*/
boolean shouldDismissPip() {
Point displaySize = new Point();
- mContext.getDisplay().getSize(displaySize);
- if (mBounds.bottom > displaySize.y) {
- float offscreenFraction = (float) (mBounds.bottom - displaySize.y) / mBounds.height();
+ mContext.getDisplay().getRealSize(displaySize);
+ final int y = displaySize.y - mStableInsets.bottom;
+ if (mBounds.bottom > y) {
+ float offscreenFraction = (float) (mBounds.bottom - y) / mBounds.height();
return offscreenFraction >= DISMISS_OFFSCREEN_FRACTION;
}
return false;