blob: 17c4b33ba96bdb845b8b32c77a0c8e0a6545b97e [file] [log] [blame]
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.service.autofill;
import android.annotation.NonNull;
import android.content.IntentSender;
import android.os.Parcelable;
import com.android.internal.util.DataClass;
/**
* Represents an inline action as part of the autofill/augmented autofill response.
*
* <p> It includes both the action intent and the UI presentation. For example, the UI can be
* associated with an intent which can open an activity for the user to manage the Autofill provider
* settings.
*/
@DataClass(
genToString = true,
genHiddenConstDefs = true,
genEqualsHashCode = true)
public final class InlineAction implements Parcelable {
/**
* Representation of the inline action.
*/
private final @NonNull InlinePresentation mInlinePresentation;
/**
* The associated intent which will be triggered when the action is selected. It will only be
* called by the OS.
*/
private final @NonNull IntentSender mAction;
// Code below generated by codegen v1.0.15.
//
// DO NOT MODIFY!
// CHECKSTYLE:OFF Generated code
//
// To regenerate run:
// $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/service/autofill/InlineAction.java
//
// To exclude the generated code from IntelliJ auto-formatting enable (one-time):
// Settings > Editor > Code Style > Formatter Control
//@formatter:off
/**
* Creates a new InlineAction.
*
* @param inlinePresentation
* Representation of the inline action.
* @param action
* The associated intent which will be triggered when the action is selected. It will only be
* invoked by the OS.
*/
@DataClass.Generated.Member
public InlineAction(
@NonNull InlinePresentation inlinePresentation,
@NonNull IntentSender action) {
this.mInlinePresentation = inlinePresentation;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mInlinePresentation);
this.mAction = action;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mAction);
// onConstructed(); // You can define this method to get a callback
}
/**
* Representation of the inline action.
*/
@DataClass.Generated.Member
public @NonNull InlinePresentation getInlinePresentation() {
return mInlinePresentation;
}
/**
* The associated intent which will be triggered when the action is selected. It will only be
* invoked by the OS.
*/
@DataClass.Generated.Member
public @NonNull IntentSender getAction() {
return mAction;
}
@Override
@DataClass.Generated.Member
public String toString() {
// You can override field toString logic by defining methods like:
// String fieldNameToString() { ... }
return "InlineAction { " +
"inlinePresentation = " + mInlinePresentation + ", " +
"action = " + mAction +
" }";
}
@Override
@DataClass.Generated.Member
public boolean equals(@android.annotation.Nullable Object o) {
// You can override field equality logic by defining either of the methods like:
// boolean fieldNameEquals(InlineAction other) { ... }
// boolean fieldNameEquals(FieldType otherValue) { ... }
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@SuppressWarnings("unchecked")
InlineAction that = (InlineAction) o;
//noinspection PointlessBooleanExpression
return true
&& java.util.Objects.equals(mInlinePresentation, that.mInlinePresentation)
&& java.util.Objects.equals(mAction, that.mAction);
}
@Override
@DataClass.Generated.Member
public int hashCode() {
// You can override field hashCode logic by defining methods like:
// int fieldNameHashCode() { ... }
int _hash = 1;
_hash = 31 * _hash + java.util.Objects.hashCode(mInlinePresentation);
_hash = 31 * _hash + java.util.Objects.hashCode(mAction);
return _hash;
}
@Override
@DataClass.Generated.Member
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
dest.writeTypedObject(mInlinePresentation, flags);
dest.writeTypedObject(mAction, flags);
}
@Override
@DataClass.Generated.Member
public int describeContents() { return 0; }
/** @hide */
@SuppressWarnings({"unchecked", "RedundantCast"})
@DataClass.Generated.Member
/* package-private */ InlineAction(@NonNull android.os.Parcel in) {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
InlinePresentation inlinePresentation = (InlinePresentation) in.readTypedObject(InlinePresentation.CREATOR);
IntentSender action = (IntentSender) in.readTypedObject(IntentSender.CREATOR);
this.mInlinePresentation = inlinePresentation;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mInlinePresentation);
this.mAction = action;
com.android.internal.util.AnnotationValidations.validate(
NonNull.class, null, mAction);
// onConstructed(); // You can define this method to get a callback
}
@DataClass.Generated.Member
public static final @NonNull Parcelable.Creator<InlineAction> CREATOR
= new Parcelable.Creator<InlineAction>() {
@Override
public InlineAction[] newArray(int size) {
return new InlineAction[size];
}
@Override
public InlineAction createFromParcel(@NonNull android.os.Parcel in) {
return new InlineAction(in);
}
};
@DataClass.Generated(
time = 1583798182424L,
codegenVersion = "1.0.15",
sourceFile = "frameworks/base/core/java/android/service/autofill/InlineAction.java",
inputSignatures = "private final @android.annotation.NonNull android.service.autofill.InlinePresentation mInlinePresentation\nprivate final @android.annotation.NonNull android.content.IntentSender mAction\nclass InlineAction extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstDefs=true, genEqualsHashCode=true)")
@Deprecated
private void __metadata() {}
//@formatter:on
// End of generated code
}