Merge "A few inline autofill API tweaks." into rvc-dev am: 658fc6d6d6
Change-Id: Ifa8aa617050dcb65d29011ba52345e8ea04c6e3f
This commit is contained in:
@@ -56980,6 +56980,7 @@ package android.view.inputmethod {
|
|||||||
method @NonNull public android.view.inline.InlinePresentationSpec getPresentationSpec();
|
method @NonNull public android.view.inline.InlinePresentationSpec getPresentationSpec();
|
||||||
method @NonNull public String getSource();
|
method @NonNull public String getSource();
|
||||||
method @NonNull public String getType();
|
method @NonNull public String getType();
|
||||||
|
method public boolean isPinned();
|
||||||
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
method public void writeToParcel(@NonNull android.os.Parcel, int);
|
||||||
field @NonNull public static final android.os.Parcelable.Creator<android.view.inputmethod.InlineSuggestionInfo> CREATOR;
|
field @NonNull public static final android.os.Parcelable.Creator<android.view.inputmethod.InlineSuggestionInfo> CREATOR;
|
||||||
field public static final String SOURCE_AUTOFILL = "android:autofill";
|
field public static final String SOURCE_AUTOFILL = "android:autofill";
|
||||||
|
|||||||
@@ -9931,6 +9931,7 @@ package android.service.autofill.augmented {
|
|||||||
method @NonNull public android.service.autofill.augmented.FillResponse build();
|
method @NonNull public android.service.autofill.augmented.FillResponse build();
|
||||||
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
|
||||||
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setFillWindow(@Nullable android.service.autofill.augmented.FillWindow);
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setFillWindow(@Nullable android.service.autofill.augmented.FillWindow);
|
||||||
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineActions(@Nullable java.util.List<android.service.autofill.InlinePresentation>);
|
||||||
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineSuggestions(@Nullable java.util.List<android.service.autofill.Dataset>);
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineSuggestions(@Nullable java.util.List<android.service.autofill.Dataset>);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3270,6 +3270,7 @@ package android.service.autofill.augmented {
|
|||||||
method @NonNull public android.service.autofill.augmented.FillResponse build();
|
method @NonNull public android.service.autofill.augmented.FillResponse build();
|
||||||
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setClientState(@Nullable android.os.Bundle);
|
||||||
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setFillWindow(@Nullable android.service.autofill.augmented.FillWindow);
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setFillWindow(@Nullable android.service.autofill.augmented.FillWindow);
|
||||||
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineActions(@Nullable java.util.List<android.service.autofill.InlinePresentation>);
|
||||||
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineSuggestions(@Nullable java.util.List<android.service.autofill.Dataset>);
|
method @NonNull public android.service.autofill.augmented.FillResponse.Builder setInlineSuggestions(@Nullable java.util.List<android.service.autofill.Dataset>);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5211,7 +5212,7 @@ package android.view.inputmethod {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class InlineSuggestionInfo implements android.os.Parcelable {
|
public final class InlineSuggestionInfo implements android.os.Parcelable {
|
||||||
method @NonNull public static android.view.inputmethod.InlineSuggestionInfo newInlineSuggestionInfo(@NonNull android.view.inline.InlinePresentationSpec, @NonNull String, @Nullable String[]);
|
method @NonNull public static android.view.inputmethod.InlineSuggestionInfo newInlineSuggestionInfo(@NonNull android.view.inline.InlinePresentationSpec, @NonNull String, @Nullable String[], @NonNull String, boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class InlineSuggestionsResponse implements android.os.Parcelable {
|
public final class InlineSuggestionsResponse implements android.os.Parcelable {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package android.service.autofill;
|
package android.service.autofill;
|
||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
|
import android.annotation.Size;
|
||||||
import android.app.slice.Slice;
|
import android.app.slice.Slice;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
@@ -24,6 +25,8 @@ import android.view.inline.InlinePresentationSpec;
|
|||||||
|
|
||||||
import com.android.internal.util.DataClass;
|
import com.android.internal.util.DataClass;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper class holding a {@link Slice} and an {@link InlinePresentationSpec} for rendering UI
|
* Wrapper class holding a {@link Slice} and an {@link InlinePresentationSpec} for rendering UI
|
||||||
* for an Inline Suggestion.
|
* for an Inline Suggestion.
|
||||||
@@ -50,6 +53,18 @@ public final class InlinePresentation implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
private final boolean mPinned;
|
private final boolean mPinned;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the autofill hints set in the slice.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
@Size(min = 0)
|
||||||
|
public String[] getAutofillHints() {
|
||||||
|
List<String> hints = mSlice.getHints();
|
||||||
|
return hints.toArray(new String[hints.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Code below generated by codegen v1.0.14.
|
// Code below generated by codegen v1.0.14.
|
||||||
@@ -214,10 +229,10 @@ public final class InlinePresentation implements Parcelable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@DataClass.Generated(
|
@DataClass.Generated(
|
||||||
time = 1579726472535L,
|
time = 1582753782651L,
|
||||||
codegenVersion = "1.0.14",
|
codegenVersion = "1.0.14",
|
||||||
sourceFile = "frameworks/base/core/java/android/service/autofill/InlinePresentation.java",
|
sourceFile = "frameworks/base/core/java/android/service/autofill/InlinePresentation.java",
|
||||||
inputSignatures = "private final @android.annotation.NonNull android.app.slice.Slice mSlice\nprivate final @android.annotation.NonNull android.view.inline.InlinePresentationSpec mInlinePresentationSpec\nprivate final boolean mPinned\nclass InlinePresentation extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstDefs=true, genEqualsHashCode=true)")
|
inputSignatures = "private final @android.annotation.NonNull android.app.slice.Slice mSlice\nprivate final @android.annotation.NonNull android.view.inline.InlinePresentationSpec mInlinePresentationSpec\nprivate final boolean mPinned\npublic @android.annotation.NonNull @android.annotation.Size(min=0L) java.lang.String[] getAutofillHints()\nclass InlinePresentation extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstDefs=true, genEqualsHashCode=true)")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private void __metadata() {}
|
private void __metadata() {}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.annotation.SystemApi;
|
|||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.service.autofill.Dataset;
|
import android.service.autofill.Dataset;
|
||||||
|
import android.service.autofill.InlinePresentation;
|
||||||
|
|
||||||
import com.android.internal.util.DataClass;
|
import com.android.internal.util.DataClass;
|
||||||
|
|
||||||
@@ -51,6 +52,13 @@ public final class FillResponse {
|
|||||||
@DataClass.PluralOf("inlineSuggestion")
|
@DataClass.PluralOf("inlineSuggestion")
|
||||||
private @Nullable List<Dataset> mInlineSuggestions;
|
private @Nullable List<Dataset> mInlineSuggestions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link InlinePresentation}s representing the inline actions. Defaults to null if no
|
||||||
|
* inline actions are provided.
|
||||||
|
*/
|
||||||
|
@DataClass.PluralOf("inlineAction")
|
||||||
|
private @Nullable List<InlinePresentation> mInlineActions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client state that {@link AugmentedAutofillService} implementation can put anything in to
|
* The client state that {@link AugmentedAutofillService} implementation can put anything in to
|
||||||
* identify the request and the response when calling
|
* identify the request and the response when calling
|
||||||
@@ -66,6 +74,10 @@ public final class FillResponse {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<InlinePresentation> defaultInlineActions() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private static Bundle defaultClientState() {
|
private static Bundle defaultClientState() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -74,6 +86,7 @@ public final class FillResponse {
|
|||||||
/** @hide */
|
/** @hide */
|
||||||
abstract static class BaseBuilder {
|
abstract static class BaseBuilder {
|
||||||
abstract FillResponse.Builder addInlineSuggestion(@NonNull Dataset value);
|
abstract FillResponse.Builder addInlineSuggestion(@NonNull Dataset value);
|
||||||
|
abstract FillResponse.Builder addInlineAction(@NonNull InlinePresentation value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -95,9 +108,11 @@ public final class FillResponse {
|
|||||||
/* package-private */ FillResponse(
|
/* package-private */ FillResponse(
|
||||||
@Nullable FillWindow fillWindow,
|
@Nullable FillWindow fillWindow,
|
||||||
@Nullable List<Dataset> inlineSuggestions,
|
@Nullable List<Dataset> inlineSuggestions,
|
||||||
|
@Nullable List<InlinePresentation> inlineActions,
|
||||||
@Nullable Bundle clientState) {
|
@Nullable Bundle clientState) {
|
||||||
this.mFillWindow = fillWindow;
|
this.mFillWindow = fillWindow;
|
||||||
this.mInlineSuggestions = inlineSuggestions;
|
this.mInlineSuggestions = inlineSuggestions;
|
||||||
|
this.mInlineActions = inlineActions;
|
||||||
this.mClientState = clientState;
|
this.mClientState = clientState;
|
||||||
|
|
||||||
// onConstructed(); // You can define this method to get a callback
|
// onConstructed(); // You can define this method to get a callback
|
||||||
@@ -124,6 +139,17 @@ public final class FillResponse {
|
|||||||
return mInlineSuggestions;
|
return mInlineSuggestions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link InlinePresentation}s representing the inline actions. Defaults to null if no
|
||||||
|
* inline actions are provided.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@DataClass.Generated.Member
|
||||||
|
public @Nullable List<InlinePresentation> getInlineActions() {
|
||||||
|
return mInlineActions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client state that {@link AugmentedAutofillService} implementation can put anything in to
|
* The client state that {@link AugmentedAutofillService} implementation can put anything in to
|
||||||
* identify the request and the response when calling
|
* identify the request and the response when calling
|
||||||
@@ -145,6 +171,7 @@ public final class FillResponse {
|
|||||||
|
|
||||||
private @Nullable FillWindow mFillWindow;
|
private @Nullable FillWindow mFillWindow;
|
||||||
private @Nullable List<Dataset> mInlineSuggestions;
|
private @Nullable List<Dataset> mInlineSuggestions;
|
||||||
|
private @Nullable List<InlinePresentation> mInlineActions;
|
||||||
private @Nullable Bundle mClientState;
|
private @Nullable Bundle mClientState;
|
||||||
|
|
||||||
private long mBuilderFieldsSet = 0L;
|
private long mBuilderFieldsSet = 0L;
|
||||||
@@ -184,6 +211,27 @@ public final class FillResponse {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The {@link InlinePresentation}s representing the inline actions. Defaults to null if no
|
||||||
|
* inline actions are provided.
|
||||||
|
*/
|
||||||
|
@DataClass.Generated.Member
|
||||||
|
public @NonNull Builder setInlineActions(@Nullable List<InlinePresentation> value) {
|
||||||
|
checkNotUsed();
|
||||||
|
mBuilderFieldsSet |= 0x4;
|
||||||
|
mInlineActions = value;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @see #setInlineActions */
|
||||||
|
@DataClass.Generated.Member
|
||||||
|
@Override
|
||||||
|
@NonNull FillResponse.Builder addInlineAction(@NonNull InlinePresentation value) {
|
||||||
|
if (mInlineActions == null) setInlineActions(new ArrayList<>());
|
||||||
|
mInlineActions.add(value);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client state that {@link AugmentedAutofillService} implementation can put anything in to
|
* The client state that {@link AugmentedAutofillService} implementation can put anything in to
|
||||||
* identify the request and the response when calling
|
* identify the request and the response when calling
|
||||||
@@ -192,7 +240,7 @@ public final class FillResponse {
|
|||||||
@DataClass.Generated.Member
|
@DataClass.Generated.Member
|
||||||
public @NonNull Builder setClientState(@Nullable Bundle value) {
|
public @NonNull Builder setClientState(@Nullable Bundle value) {
|
||||||
checkNotUsed();
|
checkNotUsed();
|
||||||
mBuilderFieldsSet |= 0x4;
|
mBuilderFieldsSet |= 0x8;
|
||||||
mClientState = value;
|
mClientState = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@@ -200,7 +248,7 @@ public final class FillResponse {
|
|||||||
/** Builds the instance. This builder should not be touched after calling this! */
|
/** Builds the instance. This builder should not be touched after calling this! */
|
||||||
public @NonNull FillResponse build() {
|
public @NonNull FillResponse build() {
|
||||||
checkNotUsed();
|
checkNotUsed();
|
||||||
mBuilderFieldsSet |= 0x8; // Mark builder used
|
mBuilderFieldsSet |= 0x10; // Mark builder used
|
||||||
|
|
||||||
if ((mBuilderFieldsSet & 0x1) == 0) {
|
if ((mBuilderFieldsSet & 0x1) == 0) {
|
||||||
mFillWindow = defaultFillWindow();
|
mFillWindow = defaultFillWindow();
|
||||||
@@ -209,17 +257,21 @@ public final class FillResponse {
|
|||||||
mInlineSuggestions = defaultInlineSuggestions();
|
mInlineSuggestions = defaultInlineSuggestions();
|
||||||
}
|
}
|
||||||
if ((mBuilderFieldsSet & 0x4) == 0) {
|
if ((mBuilderFieldsSet & 0x4) == 0) {
|
||||||
|
mInlineActions = defaultInlineActions();
|
||||||
|
}
|
||||||
|
if ((mBuilderFieldsSet & 0x8) == 0) {
|
||||||
mClientState = defaultClientState();
|
mClientState = defaultClientState();
|
||||||
}
|
}
|
||||||
FillResponse o = new FillResponse(
|
FillResponse o = new FillResponse(
|
||||||
mFillWindow,
|
mFillWindow,
|
||||||
mInlineSuggestions,
|
mInlineSuggestions,
|
||||||
|
mInlineActions,
|
||||||
mClientState);
|
mClientState);
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkNotUsed() {
|
private void checkNotUsed() {
|
||||||
if ((mBuilderFieldsSet & 0x8) != 0) {
|
if ((mBuilderFieldsSet & 0x10) != 0) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"This Builder should not be reused. Use a new Builder instance instead");
|
"This Builder should not be reused. Use a new Builder instance instead");
|
||||||
}
|
}
|
||||||
@@ -227,10 +279,10 @@ public final class FillResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@DataClass.Generated(
|
@DataClass.Generated(
|
||||||
time = 1580335256422L,
|
time = 1582682935951L,
|
||||||
codegenVersion = "1.0.14",
|
codegenVersion = "1.0.14",
|
||||||
sourceFile = "frameworks/base/core/java/android/service/autofill/augmented/FillResponse.java",
|
sourceFile = "frameworks/base/core/java/android/service/autofill/augmented/FillResponse.java",
|
||||||
inputSignatures = "private @android.annotation.Nullable android.service.autofill.augmented.FillWindow mFillWindow\nprivate @com.android.internal.util.DataClass.PluralOf(\"inlineSuggestion\") @android.annotation.Nullable java.util.List<android.service.autofill.Dataset> mInlineSuggestions\nprivate @android.annotation.Nullable android.os.Bundle mClientState\nprivate static android.service.autofill.augmented.FillWindow defaultFillWindow()\nprivate static java.util.List<android.service.autofill.Dataset> defaultInlineSuggestions()\nprivate static android.os.Bundle defaultClientState()\nclass FillResponse extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=true, genHiddenGetters=true)\nabstract android.service.autofill.augmented.FillResponse.Builder addInlineSuggestion(android.service.autofill.Dataset)\nclass BaseBuilder extends java.lang.Object implements []")
|
inputSignatures = "private @android.annotation.Nullable android.service.autofill.augmented.FillWindow mFillWindow\nprivate @com.android.internal.util.DataClass.PluralOf(\"inlineSuggestion\") @android.annotation.Nullable java.util.List<android.service.autofill.Dataset> mInlineSuggestions\nprivate @com.android.internal.util.DataClass.PluralOf(\"inlineAction\") @android.annotation.Nullable java.util.List<android.service.autofill.InlinePresentation> mInlineActions\nprivate @android.annotation.Nullable android.os.Bundle mClientState\nprivate static android.service.autofill.augmented.FillWindow defaultFillWindow()\nprivate static java.util.List<android.service.autofill.Dataset> defaultInlineSuggestions()\nprivate static java.util.List<android.service.autofill.InlinePresentation> defaultInlineActions()\nprivate static android.os.Bundle defaultClientState()\nclass FillResponse extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genBuilder=true, genHiddenGetters=true)\nabstract android.service.autofill.augmented.FillResponse.Builder addInlineSuggestion(android.service.autofill.Dataset)\nabstract android.service.autofill.augmented.FillResponse.Builder addInlineAction(android.service.autofill.InlinePresentation)\nclass BaseBuilder extends java.lang.Object implements []")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private void __metadata() {}
|
private void __metadata() {}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
/** The type of the UI. */
|
/** The type of the UI. */
|
||||||
private final @NonNull @Type String mType;
|
private final @NonNull @Type String mType;
|
||||||
|
|
||||||
|
/** Whether the suggestion should be pinned or not. */
|
||||||
|
private final boolean mPinned;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link InlineSuggestionInfo}, for testing purpose.
|
* Creates a new {@link InlineSuggestionInfo}, for testing purpose.
|
||||||
*
|
*
|
||||||
@@ -79,8 +82,8 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
public static InlineSuggestionInfo newInlineSuggestionInfo(
|
public static InlineSuggestionInfo newInlineSuggestionInfo(
|
||||||
@NonNull InlinePresentationSpec presentationSpec,
|
@NonNull InlinePresentationSpec presentationSpec,
|
||||||
@NonNull @Source String source,
|
@NonNull @Source String source,
|
||||||
@Nullable String[] autofillHints) {
|
@Nullable String[] autofillHints, @NonNull @Type String type, boolean isPinned) {
|
||||||
return new InlineSuggestionInfo(presentationSpec, source, autofillHints, TYPE_SUGGESTION);
|
return new InlineSuggestionInfo(presentationSpec, source, autofillHints, type, isPinned);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -127,6 +130,8 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
* Hints for the type of data being suggested.
|
* Hints for the type of data being suggested.
|
||||||
* @param type
|
* @param type
|
||||||
* The type of the UI.
|
* The type of the UI.
|
||||||
|
* @param pinned
|
||||||
|
* Whether the suggestion should be pinned or not.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@DataClass.Generated.Member
|
@DataClass.Generated.Member
|
||||||
@@ -134,7 +139,8 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
@NonNull InlinePresentationSpec presentationSpec,
|
@NonNull InlinePresentationSpec presentationSpec,
|
||||||
@NonNull @Source String source,
|
@NonNull @Source String source,
|
||||||
@Nullable String[] autofillHints,
|
@Nullable String[] autofillHints,
|
||||||
@NonNull @Type String type) {
|
@NonNull @Type String type,
|
||||||
|
boolean pinned) {
|
||||||
this.mPresentationSpec = presentationSpec;
|
this.mPresentationSpec = presentationSpec;
|
||||||
com.android.internal.util.AnnotationValidations.validate(
|
com.android.internal.util.AnnotationValidations.validate(
|
||||||
NonNull.class, null, mPresentationSpec);
|
NonNull.class, null, mPresentationSpec);
|
||||||
@@ -163,6 +169,7 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
|
|
||||||
com.android.internal.util.AnnotationValidations.validate(
|
com.android.internal.util.AnnotationValidations.validate(
|
||||||
NonNull.class, null, mType);
|
NonNull.class, null, mType);
|
||||||
|
this.mPinned = pinned;
|
||||||
|
|
||||||
// onConstructed(); // You can define this method to get a callback
|
// onConstructed(); // You can define this method to get a callback
|
||||||
}
|
}
|
||||||
@@ -199,6 +206,14 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
return mType;
|
return mType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the suggestion should be pinned or not.
|
||||||
|
*/
|
||||||
|
@DataClass.Generated.Member
|
||||||
|
public boolean isPinned() {
|
||||||
|
return mPinned;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataClass.Generated.Member
|
@DataClass.Generated.Member
|
||||||
public String toString() {
|
public String toString() {
|
||||||
@@ -209,7 +224,8 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
"presentationSpec = " + mPresentationSpec + ", " +
|
"presentationSpec = " + mPresentationSpec + ", " +
|
||||||
"source = " + mSource + ", " +
|
"source = " + mSource + ", " +
|
||||||
"autofillHints = " + java.util.Arrays.toString(mAutofillHints) + ", " +
|
"autofillHints = " + java.util.Arrays.toString(mAutofillHints) + ", " +
|
||||||
"type = " + mType +
|
"type = " + mType + ", " +
|
||||||
|
"pinned = " + mPinned +
|
||||||
" }";
|
" }";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +245,8 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
&& java.util.Objects.equals(mPresentationSpec, that.mPresentationSpec)
|
&& java.util.Objects.equals(mPresentationSpec, that.mPresentationSpec)
|
||||||
&& java.util.Objects.equals(mSource, that.mSource)
|
&& java.util.Objects.equals(mSource, that.mSource)
|
||||||
&& java.util.Arrays.equals(mAutofillHints, that.mAutofillHints)
|
&& java.util.Arrays.equals(mAutofillHints, that.mAutofillHints)
|
||||||
&& java.util.Objects.equals(mType, that.mType);
|
&& java.util.Objects.equals(mType, that.mType)
|
||||||
|
&& mPinned == that.mPinned;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -243,6 +260,7 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
_hash = 31 * _hash + java.util.Objects.hashCode(mSource);
|
_hash = 31 * _hash + java.util.Objects.hashCode(mSource);
|
||||||
_hash = 31 * _hash + java.util.Arrays.hashCode(mAutofillHints);
|
_hash = 31 * _hash + java.util.Arrays.hashCode(mAutofillHints);
|
||||||
_hash = 31 * _hash + java.util.Objects.hashCode(mType);
|
_hash = 31 * _hash + java.util.Objects.hashCode(mType);
|
||||||
|
_hash = 31 * _hash + Boolean.hashCode(mPinned);
|
||||||
return _hash;
|
return _hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,6 +271,7 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
// void parcelFieldName(Parcel dest, int flags) { ... }
|
// void parcelFieldName(Parcel dest, int flags) { ... }
|
||||||
|
|
||||||
byte flg = 0;
|
byte flg = 0;
|
||||||
|
if (mPinned) flg |= 0x10;
|
||||||
if (mAutofillHints != null) flg |= 0x4;
|
if (mAutofillHints != null) flg |= 0x4;
|
||||||
dest.writeByte(flg);
|
dest.writeByte(flg);
|
||||||
dest.writeTypedObject(mPresentationSpec, flags);
|
dest.writeTypedObject(mPresentationSpec, flags);
|
||||||
@@ -273,6 +292,7 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
// static FieldType unparcelFieldName(Parcel in) { ... }
|
// static FieldType unparcelFieldName(Parcel in) { ... }
|
||||||
|
|
||||||
byte flg = in.readByte();
|
byte flg = in.readByte();
|
||||||
|
boolean pinned = (flg & 0x10) != 0;
|
||||||
InlinePresentationSpec presentationSpec = (InlinePresentationSpec) in.readTypedObject(InlinePresentationSpec.CREATOR);
|
InlinePresentationSpec presentationSpec = (InlinePresentationSpec) in.readTypedObject(InlinePresentationSpec.CREATOR);
|
||||||
String source = in.readString();
|
String source = in.readString();
|
||||||
String[] autofillHints = (flg & 0x4) == 0 ? null : in.createStringArray();
|
String[] autofillHints = (flg & 0x4) == 0 ? null : in.createStringArray();
|
||||||
@@ -306,6 +326,7 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
|
|
||||||
com.android.internal.util.AnnotationValidations.validate(
|
com.android.internal.util.AnnotationValidations.validate(
|
||||||
NonNull.class, null, mType);
|
NonNull.class, null, mType);
|
||||||
|
this.mPinned = pinned;
|
||||||
|
|
||||||
// onConstructed(); // You can define this method to get a callback
|
// onConstructed(); // You can define this method to get a callback
|
||||||
}
|
}
|
||||||
@@ -325,10 +346,10 @@ public final class InlineSuggestionInfo implements Parcelable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
@DataClass.Generated(
|
@DataClass.Generated(
|
||||||
time = 1579806757327L,
|
time = 1582753084046L,
|
||||||
codegenVersion = "1.0.14",
|
codegenVersion = "1.0.14",
|
||||||
sourceFile = "frameworks/base/core/java/android/view/inputmethod/InlineSuggestionInfo.java",
|
sourceFile = "frameworks/base/core/java/android/view/inputmethod/InlineSuggestionInfo.java",
|
||||||
inputSignatures = "public static final @android.view.inputmethod.InlineSuggestionInfo.Source java.lang.String SOURCE_AUTOFILL\npublic static final @android.view.inputmethod.InlineSuggestionInfo.Source java.lang.String SOURCE_PLATFORM\npublic static final @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String TYPE_SUGGESTION\npublic static final @android.annotation.SuppressLint({\"IntentName\"}) @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String TYPE_ACTION\nprivate final @android.annotation.NonNull android.view.inline.InlinePresentationSpec mPresentationSpec\nprivate final @android.annotation.NonNull @android.view.inputmethod.InlineSuggestionInfo.Source java.lang.String mSource\nprivate final @android.annotation.Nullable java.lang.String[] mAutofillHints\nprivate final @android.annotation.NonNull @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String mType\npublic static @android.annotation.TestApi @android.annotation.NonNull android.view.inputmethod.InlineSuggestionInfo newInlineSuggestionInfo(android.view.inline.InlinePresentationSpec,java.lang.String,java.lang.String[])\nclass InlineSuggestionInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genHiddenConstDefs=true, genHiddenConstructor=true)")
|
inputSignatures = "public static final @android.view.inputmethod.InlineSuggestionInfo.Source java.lang.String SOURCE_AUTOFILL\npublic static final @android.view.inputmethod.InlineSuggestionInfo.Source java.lang.String SOURCE_PLATFORM\npublic static final @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String TYPE_SUGGESTION\npublic static final @android.annotation.SuppressLint({\"IntentName\"}) @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String TYPE_ACTION\nprivate final @android.annotation.NonNull android.view.inline.InlinePresentationSpec mPresentationSpec\nprivate final @android.annotation.NonNull @android.view.inputmethod.InlineSuggestionInfo.Source java.lang.String mSource\nprivate final @android.annotation.Nullable java.lang.String[] mAutofillHints\nprivate final @android.annotation.NonNull @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String mType\nprivate final boolean mPinned\npublic static @android.annotation.TestApi @android.annotation.NonNull android.view.inputmethod.InlineSuggestionInfo newInlineSuggestionInfo(android.view.inline.InlinePresentationSpec,java.lang.String,java.lang.String[],java.lang.String,boolean)\nclass InlineSuggestionInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genHiddenConstDefs=true, genHiddenConstructor=true)")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
private void __metadata() {}
|
private void __metadata() {}
|
||||||
|
|
||||||
|
|||||||
@@ -219,12 +219,12 @@ public final class InlineSuggestionFactory {
|
|||||||
@Nullable RemoteInlineSuggestionRenderService remoteRenderService,
|
@Nullable RemoteInlineSuggestionRenderService remoteRenderService,
|
||||||
@NonNull Runnable onErrorCallback, @Nullable IBinder hostInputToken,
|
@NonNull Runnable onErrorCallback, @Nullable IBinder hostInputToken,
|
||||||
int displayId) {
|
int displayId) {
|
||||||
// TODO(b/146453195): fill in the autofill hint properly.
|
|
||||||
final InlineSuggestionInfo inlineSuggestionInfo = new InlineSuggestionInfo(
|
final InlineSuggestionInfo inlineSuggestionInfo = new InlineSuggestionInfo(
|
||||||
inlinePresentation.getInlinePresentationSpec(),
|
inlinePresentation.getInlinePresentationSpec(),
|
||||||
isAugmented ? InlineSuggestionInfo.SOURCE_PLATFORM
|
isAugmented ? InlineSuggestionInfo.SOURCE_PLATFORM
|
||||||
: InlineSuggestionInfo.SOURCE_AUTOFILL, new String[]{""},
|
: InlineSuggestionInfo.SOURCE_AUTOFILL,
|
||||||
InlineSuggestionInfo.TYPE_ACTION);
|
inlinePresentation.getAutofillHints(),
|
||||||
|
InlineSuggestionInfo.TYPE_ACTION, inlinePresentation.isPinned());
|
||||||
final Runnable onClickAction = () -> {
|
final Runnable onClickAction = () -> {
|
||||||
Toast.makeText(context, "icon clicked", Toast.LENGTH_SHORT).show();
|
Toast.makeText(context, "icon clicked", Toast.LENGTH_SHORT).show();
|
||||||
};
|
};
|
||||||
@@ -240,12 +240,12 @@ public final class InlineSuggestionFactory {
|
|||||||
@NonNull RemoteInlineSuggestionRenderService remoteRenderService,
|
@NonNull RemoteInlineSuggestionRenderService remoteRenderService,
|
||||||
@NonNull Runnable onErrorCallback, @Nullable IBinder hostInputToken,
|
@NonNull Runnable onErrorCallback, @Nullable IBinder hostInputToken,
|
||||||
int displayId) {
|
int displayId) {
|
||||||
// TODO(b/146453195): fill in the autofill hint properly.
|
|
||||||
final InlineSuggestionInfo inlineSuggestionInfo = new InlineSuggestionInfo(
|
final InlineSuggestionInfo inlineSuggestionInfo = new InlineSuggestionInfo(
|
||||||
inlinePresentation.getInlinePresentationSpec(),
|
inlinePresentation.getInlinePresentationSpec(),
|
||||||
isAugmented ? InlineSuggestionInfo.SOURCE_PLATFORM
|
isAugmented ? InlineSuggestionInfo.SOURCE_PLATFORM
|
||||||
: InlineSuggestionInfo.SOURCE_AUTOFILL, new String[]{""},
|
: InlineSuggestionInfo.SOURCE_AUTOFILL,
|
||||||
InlineSuggestionInfo.TYPE_SUGGESTION);
|
inlinePresentation.getAutofillHints(),
|
||||||
|
InlineSuggestionInfo.TYPE_SUGGESTION, inlinePresentation.isPinned());
|
||||||
|
|
||||||
final InlineSuggestion inlineSuggestion = new InlineSuggestion(inlineSuggestionInfo,
|
final InlineSuggestion inlineSuggestion = new InlineSuggestion(inlineSuggestionInfo,
|
||||||
createInlineContentProvider(inlinePresentation,
|
createInlineContentProvider(inlinePresentation,
|
||||||
@@ -262,7 +262,8 @@ public final class InlineSuggestionFactory {
|
|||||||
@Nullable IBinder hostInputToken, int displayId) {
|
@Nullable IBinder hostInputToken, int displayId) {
|
||||||
final InlineSuggestionInfo inlineSuggestionInfo = new InlineSuggestionInfo(
|
final InlineSuggestionInfo inlineSuggestionInfo = new InlineSuggestionInfo(
|
||||||
inlinePresentation.getInlinePresentationSpec(),
|
inlinePresentation.getInlinePresentationSpec(),
|
||||||
InlineSuggestionInfo.SOURCE_AUTOFILL, null, InlineSuggestionInfo.TYPE_SUGGESTION);
|
InlineSuggestionInfo.SOURCE_AUTOFILL, inlinePresentation.getAutofillHints(),
|
||||||
|
InlineSuggestionInfo.TYPE_SUGGESTION, inlinePresentation.isPinned());
|
||||||
|
|
||||||
return new InlineSuggestion(inlineSuggestionInfo,
|
return new InlineSuggestion(inlineSuggestionInfo,
|
||||||
createInlineContentProvider(inlinePresentation,
|
createInlineContentProvider(inlinePresentation,
|
||||||
|
|||||||
Reference in New Issue
Block a user