Merge "Replace Nullable bundle with NonNull and use Bundle.EMPTY" into rvc-dev am: f1771c0d33

Change-Id: I1f12af050790ece8574c7e7f8f1545ab35fff369
This commit is contained in:
Feng Cao
2020-04-01 02:50:49 +00:00
committed by Automerger Merge Worker
7 changed files with 61 additions and 56 deletions

View File

@@ -56973,7 +56973,7 @@ package android.view.inputmethod {
public final class InlineSuggestionsRequest implements android.os.Parcelable {
method public int describeContents();
method @Nullable public android.os.Bundle getExtras();
method @NonNull public android.os.Bundle getExtras();
method @NonNull public String getHostPackageName();
method @NonNull public java.util.List<android.widget.inline.InlinePresentationSpec> getInlinePresentationSpecs();
method public int getMaxSuggestionCount();
@@ -61601,7 +61601,7 @@ package android.widget.inline {
method public int describeContents();
method @NonNull public android.util.Size getMaxSize();
method @NonNull public android.util.Size getMinSize();
method @Nullable public android.os.Bundle getStyle();
method @NonNull public android.os.Bundle getStyle();
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.widget.inline.InlinePresentationSpec> CREATOR;
}

View File

@@ -9533,7 +9533,7 @@ package android.service.autofill {
public abstract class InlineSuggestionRenderService extends android.app.Service {
ctor public InlineSuggestionRenderService();
method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
method @Nullable public android.os.Bundle onGetInlineSuggestionsRendererInfo();
method @NonNull public android.os.Bundle onGetInlineSuggestionsRendererInfo();
method @Nullable public android.view.View onRenderSuggestion(@NonNull android.service.autofill.InlinePresentation, int, int);
method public final void startIntentSender(@NonNull android.content.IntentSender);
field public static final String SERVICE_INTERFACE = "android.service.autofill.InlineSuggestionRenderService";

View File

@@ -3191,7 +3191,7 @@ package android.service.autofill {
public abstract class InlineSuggestionRenderService extends android.app.Service {
ctor public InlineSuggestionRenderService();
method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent);
method @Nullable public android.os.Bundle onGetInlineSuggestionsRendererInfo();
method @NonNull public android.os.Bundle onGetInlineSuggestionsRendererInfo();
method @Nullable public android.view.View onRenderSuggestion(@NonNull android.service.autofill.InlinePresentation, int, int);
method public final void startIntentSender(@NonNull android.content.IntentSender);
field public static final String SERVICE_INTERFACE = "android.service.autofill.InlineSuggestionRenderService";

View File

@@ -173,11 +173,12 @@ public abstract class InlineSuggestionRenderService extends Service {
}
/**
* Returns the metadata about the renderer. Returns {@code null} if no metadata is provided.
* Returns the metadata about the renderer. Returns {@code Bundle.Empty} if no metadata is
* provided.
*/
@Nullable
@NonNull
public Bundle onGetInlineSuggestionsRendererInfo() {
return null;
return Bundle.EMPTY;
}
/**

View File

@@ -48,14 +48,14 @@ public final class InlinePresentationSpec implements Parcelable {
private final Size mMaxSize;
/**
* The extras encoding the UI style information. Defaults to {@code null} in which case the
* default system UI style will be used.
* The extras encoding the UI style information. Defaults to {@code Bundle.EMPTY} in which case
* the default system UI style will be used.
*/
@Nullable
@NonNull
private final Bundle mStyle;
private static Bundle defaultStyle() {
return null;
return Bundle.EMPTY;
}
/** @hide */
@@ -124,7 +124,7 @@ public final class InlinePresentationSpec implements Parcelable {
/* package-private */ InlinePresentationSpec(
@NonNull Size minSize,
@NonNull Size maxSize,
@Nullable Bundle style) {
@NonNull Bundle style) {
this.mMinSize = minSize;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMinSize);
@@ -132,6 +132,8 @@ public final class InlinePresentationSpec implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMaxSize);
this.mStyle = style;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mStyle);
// onConstructed(); // You can define this method to get a callback
}
@@ -155,11 +157,11 @@ public final class InlinePresentationSpec implements Parcelable {
}
/**
* The extras encoding the UI style information. Defaults to {@code null} in which case the
* default system UI style will be used.
* The extras encoding the UI style information. Defaults to {@code Bundle.EMPTY} in which case
* the default system UI style will be used.
*/
@DataClass.Generated.Member
public @Nullable Bundle getStyle() {
public @NonNull Bundle getStyle() {
return mStyle;
}
@@ -213,12 +215,9 @@ public final class InlinePresentationSpec implements Parcelable {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
byte flg = 0;
if (mStyle != null) flg |= 0x4;
dest.writeByte(flg);
dest.writeSize(mMinSize);
dest.writeSize(mMaxSize);
if (mStyle != null) dest.writeBundle(mStyle);
dest.writeBundle(mStyle);
}
@Override
@@ -232,10 +231,9 @@ public final class InlinePresentationSpec implements Parcelable {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
byte flg = in.readByte();
Size minSize = (Size) in.readSize();
Size maxSize = (Size) in.readSize();
Bundle style = (flg & 0x4) == 0 ? null : in.readBundle();
Bundle style = in.readBundle();
this.mMinSize = minSize;
com.android.internal.util.AnnotationValidations.validate(
@@ -244,6 +242,8 @@ public final class InlinePresentationSpec implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMaxSize);
this.mStyle = style;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mStyle);
// onConstructed(); // You can define this method to get a callback
}
@@ -271,7 +271,7 @@ public final class InlinePresentationSpec implements Parcelable {
private @NonNull Size mMinSize;
private @NonNull Size mMaxSize;
private @Nullable Bundle mStyle;
private @NonNull Bundle mStyle;
private long mBuilderFieldsSet = 0L;
@@ -296,8 +296,8 @@ public final class InlinePresentationSpec implements Parcelable {
}
/**
* The extras encoding the UI style information. Defaults to {@code null} in which case the
* default system UI style will be used.
* The extras encoding the UI style information. Defaults to {@code Bundle.EMPTY} in which case
* the default system UI style will be used.
*/
@DataClass.Generated.Member
public @NonNull Builder setStyle(@NonNull Bundle value) {
@@ -333,10 +333,10 @@ public final class InlinePresentationSpec implements Parcelable {
}
@DataClass.Generated(
time = 1585634825103L,
time = 1585691139012L,
codegenVersion = "1.0.15",
sourceFile = "frameworks/base/core/java/android/view/inline/InlinePresentationSpec.java",
inputSignatures = "private final @android.annotation.NonNull android.util.Size mMinSize\nprivate final @android.annotation.NonNull android.util.Size mMaxSize\nprivate final @android.annotation.Nullable android.os.Bundle mStyle\nprivate static android.os.Bundle defaultStyle()\npublic android.widget.inline.InlinePresentationSpec toWidget()\npublic static android.view.inline.InlinePresentationSpec fromWidget(android.widget.inline.InlinePresentationSpec)\npublic static java.util.List<android.view.inline.InlinePresentationSpec> fromWidgets(java.util.List<android.widget.inline.InlinePresentationSpec>)\nclass InlinePresentationSpec extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nclass BaseBuilder extends java.lang.Object implements []")
inputSignatures = "private final @android.annotation.NonNull android.util.Size mMinSize\nprivate final @android.annotation.NonNull android.util.Size mMaxSize\nprivate final @android.annotation.NonNull android.os.Bundle mStyle\nprivate static android.os.Bundle defaultStyle()\npublic android.widget.inline.InlinePresentationSpec toWidget()\npublic static android.view.inline.InlinePresentationSpec fromWidget(android.widget.inline.InlinePresentationSpec)\npublic static java.util.List<android.view.inline.InlinePresentationSpec> fromWidgets(java.util.List<android.widget.inline.InlinePresentationSpec>)\nclass InlinePresentationSpec extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nclass BaseBuilder extends java.lang.Object implements []")
@Deprecated
private void __metadata() {}

View File

@@ -73,7 +73,7 @@ public final class InlineSuggestionsRequest implements Parcelable {
/**
* The extras state propagated from the IME to pass extra data.
*/
private @Nullable Bundle mExtras;
private @NonNull Bundle mExtras;
/**
* The host input token of the IME that made the request. This will be set by the system for
@@ -158,9 +158,9 @@ public final class InlineSuggestionsRequest implements Parcelable {
return Display.INVALID_DISPLAY;
}
@Nullable
@NonNull
private static Bundle defaultExtras() {
return null;
return Bundle.EMPTY;
}
/** @hide */
@@ -207,7 +207,7 @@ public final class InlineSuggestionsRequest implements Parcelable {
@NonNull List<InlinePresentationSpec> inlinePresentationSpecs,
@NonNull String hostPackageName,
@NonNull LocaleList supportedLocales,
@Nullable Bundle extras,
@NonNull Bundle extras,
@Nullable IBinder hostInputToken,
int hostDisplayId) {
this.mMaxSuggestionCount = maxSuggestionCount;
@@ -221,6 +221,8 @@ public final class InlineSuggestionsRequest implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mSupportedLocales);
this.mExtras = extras;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mExtras);
this.mHostInputToken = hostInputToken;
this.mHostDisplayId = hostDisplayId;
@@ -269,7 +271,7 @@ public final class InlineSuggestionsRequest implements Parcelable {
* The extras state propagated from the IME to pass extra data.
*/
@DataClass.Generated.Member
public @Nullable Bundle getExtras() {
public @NonNull Bundle getExtras() {
return mExtras;
}
@@ -358,14 +360,13 @@ public final class InlineSuggestionsRequest implements Parcelable {
// void parcelFieldName(Parcel dest, int flags) { ... }
byte flg = 0;
if (mExtras != null) flg |= 0x10;
if (mHostInputToken != null) flg |= 0x20;
dest.writeByte(flg);
dest.writeInt(mMaxSuggestionCount);
dest.writeParcelableList(mInlinePresentationSpecs, flags);
dest.writeString(mHostPackageName);
dest.writeTypedObject(mSupportedLocales, flags);
if (mExtras != null) dest.writeBundle(mExtras);
dest.writeBundle(mExtras);
parcelHostInputToken(dest, flags);
dest.writeInt(mHostDisplayId);
}
@@ -387,7 +388,7 @@ public final class InlineSuggestionsRequest implements Parcelable {
in.readParcelableList(inlinePresentationSpecs, InlinePresentationSpec.class.getClassLoader());
String hostPackageName = in.readString();
LocaleList supportedLocales = (LocaleList) in.readTypedObject(LocaleList.CREATOR);
Bundle extras = (flg & 0x10) == 0 ? null : in.readBundle();
Bundle extras = in.readBundle();
IBinder hostInputToken = unparcelHostInputToken(in);
int hostDisplayId = in.readInt();
@@ -402,6 +403,8 @@ public final class InlineSuggestionsRequest implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mSupportedLocales);
this.mExtras = extras;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mExtras);
this.mHostInputToken = hostInputToken;
this.mHostDisplayId = hostDisplayId;
@@ -433,7 +436,7 @@ public final class InlineSuggestionsRequest implements Parcelable {
private @NonNull List<InlinePresentationSpec> mInlinePresentationSpecs;
private @NonNull String mHostPackageName;
private @NonNull LocaleList mSupportedLocales;
private @Nullable Bundle mExtras;
private @NonNull Bundle mExtras;
private @Nullable IBinder mHostInputToken;
private int mHostDisplayId;
@@ -600,10 +603,10 @@ public final class InlineSuggestionsRequest implements Parcelable {
}
@DataClass.Generated(
time = 1585633573804L,
time = 1585691147541L,
codegenVersion = "1.0.15",
sourceFile = "frameworks/base/core/java/android/view/inputmethod/InlineSuggestionsRequest.java",
inputSignatures = "public static final int SUGGESTION_COUNT_UNLIMITED\nprivate final int mMaxSuggestionCount\nprivate final @android.annotation.NonNull java.util.List<android.widget.inline.InlinePresentationSpec> mInlinePresentationSpecs\nprivate @android.annotation.NonNull java.lang.String mHostPackageName\nprivate @android.annotation.NonNull android.os.LocaleList mSupportedLocales\nprivate @android.annotation.Nullable android.os.Bundle mExtras\nprivate @android.annotation.Nullable android.os.IBinder mHostInputToken\nprivate int mHostDisplayId\npublic @android.compat.annotation.UnsupportedAppUsage @android.annotation.NonNull java.util.List<android.view.inline.InlinePresentationSpec> getPresentationSpecs()\npublic void setHostInputToken(android.os.IBinder)\nprivate void parcelHostInputToken(android.os.Parcel,int)\nprivate @android.annotation.Nullable android.os.IBinder unparcelHostInputToken(android.os.Parcel)\npublic void setHostDisplayId(int)\nprivate void onConstructed()\nprivate static int defaultMaxSuggestionCount()\nprivate static java.lang.String defaultHostPackageName()\nprivate static android.os.LocaleList defaultSupportedLocales()\nprivate static @android.annotation.Nullable android.os.IBinder defaultHostInputToken()\nprivate static @android.annotation.Nullable int defaultHostDisplayId()\nprivate static @android.annotation.Nullable android.os.Bundle defaultExtras()\nclass InlineSuggestionsRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\npublic @android.compat.annotation.UnsupportedAppUsage @android.annotation.NonNull android.view.inputmethod.InlineSuggestionsRequest.Builder addPresentationSpecs(android.view.inline.InlinePresentationSpec)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []")
inputSignatures = "public static final int SUGGESTION_COUNT_UNLIMITED\nprivate final int mMaxSuggestionCount\nprivate final @android.annotation.NonNull java.util.List<android.widget.inline.InlinePresentationSpec> mInlinePresentationSpecs\nprivate @android.annotation.NonNull java.lang.String mHostPackageName\nprivate @android.annotation.NonNull android.os.LocaleList mSupportedLocales\nprivate @android.annotation.NonNull android.os.Bundle mExtras\nprivate @android.annotation.Nullable android.os.IBinder mHostInputToken\nprivate int mHostDisplayId\npublic @android.compat.annotation.UnsupportedAppUsage @android.annotation.NonNull java.util.List<android.view.inline.InlinePresentationSpec> getPresentationSpecs()\npublic void setHostInputToken(android.os.IBinder)\nprivate void parcelHostInputToken(android.os.Parcel,int)\nprivate @android.annotation.Nullable android.os.IBinder unparcelHostInputToken(android.os.Parcel)\npublic void setHostDisplayId(int)\nprivate void onConstructed()\nprivate static int defaultMaxSuggestionCount()\nprivate static java.lang.String defaultHostPackageName()\nprivate static android.os.LocaleList defaultSupportedLocales()\nprivate static @android.annotation.Nullable android.os.IBinder defaultHostInputToken()\nprivate static @android.annotation.Nullable int defaultHostDisplayId()\nprivate static @android.annotation.NonNull android.os.Bundle defaultExtras()\nclass InlineSuggestionsRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\npublic @android.compat.annotation.UnsupportedAppUsage @android.annotation.NonNull android.view.inputmethod.InlineSuggestionsRequest.Builder addPresentationSpecs(android.view.inline.InlinePresentationSpec)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []")
@Deprecated
private void __metadata() {}

View File

@@ -41,14 +41,15 @@ public final class InlinePresentationSpec implements Parcelable {
private final Size mMaxSize;
/**
* The extras encoding the UI style information. Defaults to {@code null} in which case the
* default system UI style will be used.
* The extras encoding the UI style information. Defaults to {@code Bundle.Empty} in which case
* the default system UI style will be used.
*/
@Nullable
@NonNull
private final Bundle mStyle;
@NonNull
private static Bundle defaultStyle() {
return null;
return Bundle.EMPTY;
}
/** @hide */
@@ -75,7 +76,7 @@ public final class InlinePresentationSpec implements Parcelable {
/* package-private */ InlinePresentationSpec(
@NonNull Size minSize,
@NonNull Size maxSize,
@Nullable Bundle style) {
@NonNull Bundle style) {
this.mMinSize = minSize;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMinSize);
@@ -83,6 +84,8 @@ public final class InlinePresentationSpec implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMaxSize);
this.mStyle = style;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mStyle);
// onConstructed(); // You can define this method to get a callback
}
@@ -104,11 +107,11 @@ public final class InlinePresentationSpec implements Parcelable {
}
/**
* The extras encoding the UI style information. Defaults to {@code null} in which case the
* default system UI style will be used.
* The extras encoding the UI style information. Defaults to {@code Bundle.Empty} in which case
* the default system UI style will be used.
*/
@DataClass.Generated.Member
public @Nullable Bundle getStyle() {
public @NonNull Bundle getStyle() {
return mStyle;
}
@@ -162,12 +165,9 @@ public final class InlinePresentationSpec implements Parcelable {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
byte flg = 0;
if (mStyle != null) flg |= 0x4;
dest.writeByte(flg);
dest.writeSize(mMinSize);
dest.writeSize(mMaxSize);
if (mStyle != null) dest.writeBundle(mStyle);
dest.writeBundle(mStyle);
}
@Override
@@ -181,10 +181,9 @@ public final class InlinePresentationSpec implements Parcelable {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
byte flg = in.readByte();
Size minSize = (Size) in.readSize();
Size maxSize = (Size) in.readSize();
Bundle style = (flg & 0x4) == 0 ? null : in.readBundle();
Bundle style = in.readBundle();
this.mMinSize = minSize;
com.android.internal.util.AnnotationValidations.validate(
@@ -193,6 +192,8 @@ public final class InlinePresentationSpec implements Parcelable {
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mMaxSize);
this.mStyle = style;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mStyle);
// onConstructed(); // You can define this method to get a callback
}
@@ -220,7 +221,7 @@ public final class InlinePresentationSpec implements Parcelable {
private @NonNull Size mMinSize;
private @NonNull Size mMaxSize;
private @Nullable Bundle mStyle;
private @NonNull Bundle mStyle;
private long mBuilderFieldsSet = 0L;
@@ -244,8 +245,8 @@ public final class InlinePresentationSpec implements Parcelable {
}
/**
* The extras encoding the UI style information. Defaults to {@code null} in which case the
* default system UI style will be used.
* The extras encoding the UI style information. Defaults to {@code Bundle.Empty} in which case
* the default system UI style will be used.
*/
@DataClass.Generated.Member
public @NonNull Builder setStyle(@NonNull Bundle value) {
@@ -279,10 +280,10 @@ public final class InlinePresentationSpec implements Parcelable {
}
@DataClass.Generated(
time = 1585174247896L,
time = 1585605466300L,
codegenVersion = "1.0.15",
sourceFile = "frameworks/base/core/java/android/widget/inline/InlinePresentationSpec.java",
inputSignatures = "private final @android.annotation.NonNull android.util.Size mMinSize\nprivate final @android.annotation.NonNull android.util.Size mMaxSize\nprivate final @android.annotation.Nullable android.os.Bundle mStyle\nprivate static android.os.Bundle defaultStyle()\nclass InlinePresentationSpec extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nclass BaseBuilder extends java.lang.Object implements []")
inputSignatures = "private final @android.annotation.NonNull android.util.Size mMinSize\nprivate final @android.annotation.NonNull android.util.Size mMaxSize\nprivate final @android.annotation.NonNull android.os.Bundle mStyle\nprivate static @android.annotation.NonNull android.os.Bundle defaultStyle()\nclass InlinePresentationSpec extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nclass BaseBuilder extends java.lang.Object implements []")
@Deprecated
private void __metadata() {}