Merge "Fix: TextBoundsInfoResult constructor should be @Nullable"

This commit is contained in:
Haoyu Zhang
2023-02-16 23:37:56 +00:00
committed by Android (Google) Code Review
2 changed files with 2 additions and 3 deletions

View File

@@ -55946,7 +55946,7 @@ package android.view.inputmethod {
public final class TextBoundsInfoResult {
ctor public TextBoundsInfoResult(int);
ctor public TextBoundsInfoResult(int, @NonNull android.view.inputmethod.TextBoundsInfo);
ctor public TextBoundsInfoResult(int, @Nullable android.view.inputmethod.TextBoundsInfo);
method public int getResultCode();
method @Nullable public android.view.inputmethod.TextBoundsInfo getTextBoundsInfo();
field public static final int CODE_CANCELLED = 3; // 0x3

View File

@@ -17,7 +17,6 @@
package android.view.inputmethod;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.RectF;
@@ -98,7 +97,7 @@ public final class TextBoundsInfoResult {
* is null.
*/
public TextBoundsInfoResult(@ResultCode int resultCode,
@NonNull TextBoundsInfo textBoundsInfo) {
@Nullable TextBoundsInfo textBoundsInfo) {
if (resultCode == CODE_SUCCESS && textBoundsInfo == null) {
throw new IllegalStateException("TextBoundsInfo must be provided when the resultCode "
+ "is CODE_SUCCESS.");