| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.service.autofill; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Size; |
| 21 |
import android.app.slice.Slice; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
import android.widget.inline.InlinePresentationSpec; |
| 25 |
|
| 26 |
import com.android.internal.util.DataClass; |
| 27 |
|
| 28 |
import java.util.List; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
@DataClass( |
| 35 |
genToString = true, |
| 36 |
genHiddenConstDefs = true, |
| 37 |
genEqualsHashCode = true) |
| 38 |
public final class InlinePresentation implements Parcelable { |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
private final @NonNull Slice mSlice; |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
private final @NonNull InlinePresentationSpec mInlinePresentationSpec; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
private final boolean mPinned; |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
@NonNull |
| 72 |
@Size(min = 0) |
| 73 |
public String[] getAutofillHints() { |
| 74 |
List<String> hints = mSlice.getHints(); |
| 75 |
return hints.toArray(new String[hints.size()]); |
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
@NonNull |
| 86 |
public static InlinePresentation createTooltipPresentation(@NonNull Slice slice, |
| 87 |
@NonNull InlinePresentationSpec spec) { |
| 88 |
return new InlinePresentation(slice, spec, false); |
| 89 |
|
| 90 |
} |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
@DataClass.Generated.Member |
| 128 |
public InlinePresentation( |
| 129 |
@NonNull Slice slice, |
| 130 |
@NonNull InlinePresentationSpec inlinePresentationSpec, |
| 131 |
boolean pinned) { |
| 132 |
this.mSlice = slice; |
| 133 |
com.android.internal.util.AnnotationValidations.validate( |
| 134 |
NonNull.class, null, mSlice); |
| 135 |
this.mInlinePresentationSpec = inlinePresentationSpec; |
| 136 |
com.android.internal.util.AnnotationValidations.validate( |
| 137 |
NonNull.class, null, mInlinePresentationSpec); |
| 138 |
this.mPinned = pinned; |
| 139 |
|
| 140 |
|
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
@DataClass.Generated.Member |
| 152 |
public @NonNull Slice getSlice() { |
| 153 |
return mSlice; |
| 154 |
} |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
@DataClass.Generated.Member |
| 160 |
public @NonNull InlinePresentationSpec getInlinePresentationSpec() { |
| 161 |
return mInlinePresentationSpec; |
| 162 |
} |
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
@DataClass.Generated.Member |
| 173 |
public boolean isPinned() { |
| 174 |
return mPinned; |
| 175 |
} |
| 176 |
|
| 177 |
@Override |
| 178 |
@DataClass.Generated.Member |
| 179 |
public String toString() { |
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
return "InlinePresentation { " + |
| 184 |
"slice = " + mSlice + ", " + |
| 185 |
"inlinePresentationSpec = " + mInlinePresentationSpec + ", " + |
| 186 |
"pinned = " + mPinned + |
| 187 |
" }"; |
| 188 |
} |
| 189 |
|
| 190 |
@Override |
| 191 |
@DataClass.Generated.Member |
| 192 |
public boolean equals(@android.annotation.Nullable Object o) { |
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
if (this == o) return true; |
| 198 |
if (o == null || getClass() != o.getClass()) return false; |
| 199 |
@SuppressWarnings("unchecked") |
| 200 |
InlinePresentation that = (InlinePresentation) o; |
| 201 |
|
| 202 |
return true |
| 203 |
&& java.util.Objects.equals(mSlice, that.mSlice) |
| 204 |
&& java.util.Objects.equals(mInlinePresentationSpec, that.mInlinePresentationSpec) |
| 205 |
&& mPinned == that.mPinned; |
| 206 |
} |
| 207 |
|
| 208 |
@Override |
| 209 |
@DataClass.Generated.Member |
| 210 |
public int hashCode() { |
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
int _hash = 1; |
| 215 |
_hash = 31 * _hash + java.util.Objects.hashCode(mSlice); |
| 216 |
_hash = 31 * _hash + java.util.Objects.hashCode(mInlinePresentationSpec); |
| 217 |
_hash = 31 * _hash + Boolean.hashCode(mPinned); |
| 218 |
return _hash; |
| 219 |
} |
| 220 |
|
| 221 |
@Override |
| 222 |
@DataClass.Generated.Member |
| 223 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
byte flg = 0; |
| 228 |
if (mPinned) flg |= 0x4; |
| 229 |
dest.writeByte(flg); |
| 230 |
dest.writeTypedObject(mSlice, flags); |
| 231 |
dest.writeTypedObject(mInlinePresentationSpec, flags); |
| 232 |
} |
| 233 |
|
| 234 |
@Override |
| 235 |
@DataClass.Generated.Member |
| 236 |
public int describeContents() { return 0; } |
| 237 |
|
| 238 |
|
| 239 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 240 |
@DataClass.Generated.Member |
| 241 |
InlinePresentation(@NonNull Parcel in) { |
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
byte flg = in.readByte(); |
| 246 |
boolean pinned = (flg & 0x4) != 0; |
| 247 |
Slice slice = (Slice) in.readTypedObject(Slice.CREATOR); |
| 248 |
InlinePresentationSpec inlinePresentationSpec = (InlinePresentationSpec) in.readTypedObject(InlinePresentationSpec.CREATOR); |
| 249 |
|
| 250 |
this.mSlice = slice; |
| 251 |
com.android.internal.util.AnnotationValidations.validate( |
| 252 |
NonNull.class, null, mSlice); |
| 253 |
this.mInlinePresentationSpec = inlinePresentationSpec; |
| 254 |
com.android.internal.util.AnnotationValidations.validate( |
| 255 |
NonNull.class, null, mInlinePresentationSpec); |
| 256 |
this.mPinned = pinned; |
| 257 |
|
| 258 |
|
| 259 |
} |
| 260 |
|
| 261 |
@DataClass.Generated.Member |
| 262 |
public static final @NonNull Parcelable.Creator<InlinePresentation> CREATOR |
| 263 |
= new Parcelable.Creator<InlinePresentation>() { |
| 264 |
@Override |
| 265 |
public InlinePresentation[] newArray(int size) { |
| 266 |
return new InlinePresentation[size]; |
| 267 |
} |
| 268 |
|
| 269 |
@Override |
| 270 |
public InlinePresentation createFromParcel(@NonNull Parcel in) { |
| 271 |
return new InlinePresentation(in); |
| 272 |
} |
| 273 |
}; |
| 274 |
|
| 275 |
@DataClass.Generated( |
| 276 |
time = 1615968415006L, |
| 277 |
codegenVersion = "1.0.22", |
| 278 |
sourceFile = "frameworks/base/core/java/android/service/autofill/InlinePresentation.java", |
| 279 |
inputSignatures = "private final @android.annotation.NonNull android.app.slice.Slice mSlice\nprivate final @android.annotation.NonNull android.widget.inline.InlinePresentationSpec mInlinePresentationSpec\nprivate final boolean mPinned\npublic @android.annotation.NonNull @android.annotation.Size java.lang.String[] getAutofillHints()\npublic static @android.annotation.NonNull android.service.autofill.InlinePresentation createTooltipPresentation(android.app.slice.Slice,android.widget.inline.InlinePresentationSpec)\nclass InlinePresentation extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstDefs=true, genEqualsHashCode=true)") |
| 280 |
@Deprecated |
| 281 |
private void __metadata() {} |
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
} |