summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jacqueline Bronger <bronger@google.com> 2022-04-04 16:53:11 +0200
committer Jacqueline Bronger <bronger@google.com> 2022-04-06 08:52:53 +0000
commit7d23b1c62491b8e8400fd7f28c96f1188a9aecc7 (patch)
tree8942e980931aeaf09532dc4aacf9260f99d838c3
parentcf4afcdd955cfdb74f7b9b4bed1cf9923d9f8eb0 (diff)
Fix gravity after re-enabling expanded PiP
Bug: 228040036 Test: manual - move expanded PiP to opposite edge, disable, then re-enable expanded PiP from test app Change-Id: I7ab4b7cb37d1e62384bc33119baf722369d4302d
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipBoundsState.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipBoundsState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipBoundsState.java
index 986554853034..a5b73eee2ae8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipBoundsState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/tv/TvPipBoundsState.java
@@ -34,7 +34,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
- * TV specific values of the current state of the PIP bounds.
+ * TV specific values of the current state of the PiP bounds.
*/
public class TvPipBoundsState extends PipBoundsState {
@@ -84,7 +84,7 @@ public class TvPipBoundsState extends PipBoundsState {
mTvPipGravity = DEFAULT_TV_GRAVITY;
}
- /** Set the tv expanded bounds of PIP */
+ /** Set the tv expanded bounds of PiP */
public void setTvExpandedSize(@Nullable Size size) {
mTvExpandedSize = size;
}
@@ -95,20 +95,24 @@ public class TvPipBoundsState extends PipBoundsState {
return mTvExpandedSize;
}
- /** Set the PIP aspect ratio for the expanded PIP (TV) that is desired by the app. */
+ /** Set the PiP aspect ratio for the expanded PiP (TV) that is desired by the app. */
public void setDesiredTvExpandedAspectRatio(float aspectRatio, boolean override) {
- if (override || mTvFixedPipOrientation == ORIENTATION_UNDETERMINED || aspectRatio == 0) {
+ if (override || mTvFixedPipOrientation == ORIENTATION_UNDETERMINED) {
mDesiredTvExpandedAspectRatio = aspectRatio;
resetTvPipState();
return;
}
if ((aspectRatio > 1 && mTvFixedPipOrientation == ORIENTATION_HORIZONTAL)
- || (aspectRatio <= 1 && mTvFixedPipOrientation == ORIENTATION_VERTICAL)) {
+ || (aspectRatio <= 1 && mTvFixedPipOrientation == ORIENTATION_VERTICAL)
+ || aspectRatio == 0) {
mDesiredTvExpandedAspectRatio = aspectRatio;
}
}
- /** Get the PIP aspect ratio for the expanded PIP (TV) that is desired by the app. */
+ /**
+ * Get the aspect ratio for the expanded PiP (TV) that is desired, or {@code 0} if it is not
+ * enabled by the app.
+ */
public float getDesiredTvExpandedAspectRatio() {
return mDesiredTvExpandedAspectRatio;
}