From 3afa6b031104b484c9fc46ceb4634f24f4b2b74c Mon Sep 17 00:00:00 2001 From: Ben Lin Date: Tue, 28 Apr 2020 14:22:56 -0700 Subject: [PATCH] Open up #getAspectRatio and #getInsetBounds. For some OEMs, they have their own SnapAlgorithm which takes the aspectRatio and inset bounds as parameters. Bug: 154155536 Test: None Change-Id: I8f26a281cc0af1523b2843011af116466a8fc55f --- .../src/com/android/systemui/pip/PipBoundsHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/PipBoundsHandler.java b/packages/SystemUI/src/com/android/systemui/pip/PipBoundsHandler.java index e24d29f1aedfd..9d9e74abc38fa 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/PipBoundsHandler.java +++ b/packages/SystemUI/src/com/android/systemui/pip/PipBoundsHandler.java @@ -126,6 +126,10 @@ public class PipBoundsHandler { mCurrentMinSize = minEdgeSize; } + protected float getAspectRatio() { + return mAspectRatio; + } + /** * Sets both shelf visibility and its height if applicable. * @return {@code true} if the internal shelf state is changed, {@code false} otherwise. @@ -419,7 +423,7 @@ public class PipBoundsHandler { /** * Populates the bounds on the screen that the PIP can be visible in. */ - private void getInsetBounds(Rect outRect) { + protected void getInsetBounds(Rect outRect) { try { mWindowManager.getStableInsets(mContext.getDisplayId(), mTmpInsets); outRect.set(mTmpInsets.left + mScreenEdgeInsets.x,