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

Commit c6f40a1a authored by Colin Cross's avatar Colin Cross
Browse files

Remove WindowConfiguration.setBounds and getBounds annotations

Kotlin can't treat getBounds and setBounds as a paired getter and setter
for an implicit property if getBounds returns @NonNull but setBounds
takes a @Nullable.  Partially revert ag/24341624 by removing the
annotations for now to fix errors from existing kotlin property usage.

Bug: 294110802
Bug: 297672475
Test: builds
Change-Id: Id476474be82cbb8d581c6389723bfde0cedc0e28
parent 6560309e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -497,14 +497,14 @@ package android.app {
    method public int describeContents();
    method public int getActivityType();
    method @Nullable public android.graphics.Rect getAppBounds();
    method @NonNull public android.graphics.Rect getBounds();
    method 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(@Nullable android.graphics.Rect);
    method public void setBounds(android.graphics.Rect);
    method public void setMaxBounds(@Nullable android.graphics.Rect);
    method public void setRotation(int);
    method public void setTo(android.app.WindowConfiguration);
+3 −2
Original line number Diff line number Diff line
@@ -267,11 +267,12 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        }
    };

    // TODO(b/297672475): make this take @Nullable
    /**
     * Sets the bounds to the provided {@link Rect}.
     * @param rect the new bounds value.
     */
    public void setBounds(@Nullable Rect rect) {
    public void setBounds(Rect rect) {
        if (rect == null) {
            mBounds.setEmpty();
            return;
@@ -363,8 +364,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;
    }