Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2d10cbc authored by Jacqueline Bronger's avatar Jacqueline Bronger Committed by Android (Google) Code Review
Browse files

Merge changes from topic "presubmit-am-bace65c5abc044d19d4290071ec1a4e0"

* changes:
  [automerge] Fix gravity after re-enabling expanded PiP 2p: 7d23b1c6 2p: 75e61b55
  [automerge] Fix gravity after re-enabling expanded PiP 2p: 7d23b1c6
  Fix gravity after re-enabling expanded PiP
parents 85b3e7a3 6c063141
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -35,7 +35,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
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 {
public class TvPipBoundsState extends PipBoundsState {


@@ -86,7 +86,7 @@ public class TvPipBoundsState extends PipBoundsState {
        mTvPipGravity = DEFAULT_TV_GRAVITY;
        mTvPipGravity = DEFAULT_TV_GRAVITY;
    }
    }


    /** Set the tv expanded bounds of PIP */
    /** Set the tv expanded bounds of PiP */
    public void setTvExpandedSize(@Nullable Size size) {
    public void setTvExpandedSize(@Nullable Size size) {
        mTvExpandedSize = size;
        mTvExpandedSize = size;
    }
    }
@@ -97,20 +97,24 @@ public class TvPipBoundsState extends PipBoundsState {
        return mTvExpandedSize;
        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) {
    public void setDesiredTvExpandedAspectRatio(float aspectRatio, boolean override) {
        if (override || mTvFixedPipOrientation == ORIENTATION_UNDETERMINED || aspectRatio == 0) {
        if (override || mTvFixedPipOrientation == ORIENTATION_UNDETERMINED) {
            mDesiredTvExpandedAspectRatio = aspectRatio;
            mDesiredTvExpandedAspectRatio = aspectRatio;
            resetTvPipState();
            resetTvPipState();
            return;
            return;
        }
        }
        if ((aspectRatio > 1 && mTvFixedPipOrientation == ORIENTATION_HORIZONTAL)
        if ((aspectRatio > 1 && mTvFixedPipOrientation == ORIENTATION_HORIZONTAL)
                || (aspectRatio <= 1 && mTvFixedPipOrientation == ORIENTATION_VERTICAL)) {
                || (aspectRatio <= 1 && mTvFixedPipOrientation == ORIENTATION_VERTICAL)
                || aspectRatio == 0) {
            mDesiredTvExpandedAspectRatio = aspectRatio;
            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() {
    public float getDesiredTvExpandedAspectRatio() {
        return mDesiredTvExpandedAspectRatio;
        return mDesiredTvExpandedAspectRatio;
    }
    }