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
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index cff5e40..d43d785 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -497,14 +497,14 @@
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);
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index e3055e5..bf238c3 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -267,11 +267,12 @@
}
};
+ // 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 @@
return mAppBounds;
}
+ // TODO(b/297672475): make this return @NonNull
/** @see #setBounds(Rect) */
- @NonNull
public Rect getBounds() {
return mBounds;
}