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

Commit 836944da authored by Chris Li's avatar Chris Li Committed by Android (Google) Code Review
Browse files

Merge "Add annotation for WindowConfiguration#setBounds" into main

parents acdc546c 474c954e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -499,14 +499,14 @@ package android.app {
    method public int describeContents();
    method public int getActivityType();
    method @Nullable public android.graphics.Rect getAppBounds();
    method public android.graphics.Rect getBounds();
    method @NonNull public android.graphics.Rect getBounds();
    method @NonNull public android.graphics.Rect getMaxBounds();
    method public int getRotation();
    method public int getWindowingMode();
    method public static boolean isFloating(int);
    method public void setActivityType(int);
    method public void setAppBounds(@Nullable android.graphics.Rect);
    method public void setBounds(android.graphics.Rect);
    method public void setBounds(@Nullable android.graphics.Rect);
    method public void setMaxBounds(@Nullable android.graphics.Rect);
    method public void setRotation(int);
    method public void setTo(android.app.WindowConfiguration);
+11 −6
Original line number Diff line number Diff line
@@ -267,12 +267,13 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        }
    };

    // TODO(b/297672475): make this take @Nullable
    /**
     * Sets the bounds to the provided {@link Rect}.
     * Passing {@code null} sets the bounds {@link Rect} to empty.
     *
     * @param rect the new bounds value.
     */
    public void setBounds(Rect rect) {
    public void setBounds(@Nullable Rect rect) {
        if (rect == null) {
            mBounds.setEmpty();
            return;
@@ -282,8 +283,10 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
    }

    /**
     * Set {@link #mAppBounds} to the input Rect.
     * @param rect The rect value to set {@link #mAppBounds} to.
     * Sets the app bounds to the provided {@link Rect}.
     * Passing {@code null} sets the bounds to {@code null}.
     *
     * @param rect the new app bounds value.
     * @see #getAppBounds()
     */
    public void setAppBounds(@Nullable Rect rect) {
@@ -297,7 +300,9 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu

    /**
     * Sets the maximum bounds to the provided {@link Rect}.
     * @param rect the new bounds value.
     * Passing {@code null} sets the bounds {@link Rect} to empty.
     *
     * @param rect the new max bounds value.
     * @see #getMaxBounds()
     */
    public void setMaxBounds(@Nullable Rect rect) {
@@ -364,8 +369,8 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        return mAppBounds;
    }

    // TODO(b/297672475): make this return @NonNull
    /** @see #setBounds(Rect) */
    @NonNull
    public Rect getBounds() {
        return mBounds;
    }
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ class DragPositioningCallbackUtilityTest {
            minHeight = MIN_HEIGHT
            defaultMinSize = DEFAULT_MIN
            displayId = DISPLAY_ID
            configuration.windowConfiguration.bounds = STARTING_BOUNDS
            configuration.windowConfiguration.setBounds(STARTING_BOUNDS)
        }
        mockWindowDecoration.mDisplay = mockDisplay
        whenever(mockDisplay.displayId).thenAnswer { DISPLAY_ID }
+1 −1
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ class FluidResizeTaskPositionerTest : ShellTestCase() {
            minHeight = MIN_HEIGHT
            defaultMinSize = DEFAULT_MIN
            displayId = DISPLAY_ID
            configuration.windowConfiguration.bounds = STARTING_BOUNDS
            configuration.windowConfiguration.setBounds(STARTING_BOUNDS)
        }
        mockWindowDecoration.mDisplay = mockDisplay
        whenever(mockDisplay.displayId).thenAnswer { DISPLAY_ID }
+1 −1
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ class VeiledResizeTaskPositionerTest : ShellTestCase() {
            minHeight = MIN_HEIGHT
            defaultMinSize = DEFAULT_MIN
            displayId = DISPLAY_ID
            configuration.windowConfiguration.bounds = STARTING_BOUNDS
            configuration.windowConfiguration.setBounds(STARTING_BOUNDS)
        }
        mockDesktopWindowDecoration.mDisplay = mockDisplay
        whenever(mockDisplay.displayId).thenAnswer { DISPLAY_ID }
Loading