| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.inputmethod; |
| 18 |
|
| 19 |
import android.annotation.NonNull; |
| 20 |
import android.annotation.Nullable; |
| 21 |
import android.annotation.SuppressLint; |
| 22 |
import android.annotation.TestApi; |
| 23 |
import android.os.Parcelable; |
| 24 |
import android.widget.inline.InlinePresentationSpec; |
| 25 |
|
| 26 |
import com.android.internal.util.DataClass; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
@DataClass( |
| 34 |
genEqualsHashCode = true, |
| 35 |
genToString = true, |
| 36 |
genHiddenConstDefs = true, |
| 37 |
genHiddenConstructor = true) |
| 38 |
public final class InlineSuggestionInfo implements Parcelable { |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public static final @Source String SOURCE_AUTOFILL = "android:autofill"; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
public static final @Source String SOURCE_PLATFORM = "android:platform"; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
public static final @Type String TYPE_SUGGESTION = "android:autofill:suggestion"; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
@SuppressLint({"IntentName"}) |
| 58 |
public static final @Type String TYPE_ACTION = "android:autofill:action"; |
| 59 |
|
| 60 |
|
| 61 |
private final @NonNull InlinePresentationSpec mInlinePresentationSpec; |
| 62 |
|
| 63 |
|
| 64 |
private final @NonNull @Source String mSource; |
| 65 |
|
| 66 |
|
| 67 |
private final @Nullable String[] mAutofillHints; |
| 68 |
|
| 69 |
|
| 70 |
private final @NonNull @Type String mType; |
| 71 |
|
| 72 |
|
| 73 |
private final boolean mPinned; |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
private final @Nullable InlineSuggestion mTooltip; |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
@TestApi |
| 86 |
@NonNull |
| 87 |
public static InlineSuggestionInfo newInlineSuggestionInfo( |
| 88 |
@NonNull InlinePresentationSpec presentationSpec, |
| 89 |
@NonNull @Source String source, |
| 90 |
@SuppressLint("NullableCollection") |
| 91 |
@Nullable String[] autofillHints, @NonNull @Type String type, boolean isPinned) { |
| 92 |
return new InlineSuggestionInfo(presentationSpec, source, autofillHints, type, isPinned, |
| 93 |
null); |
| 94 |
} |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
@NonNull |
| 102 |
public static InlineSuggestionInfo newInlineSuggestionInfo( |
| 103 |
@NonNull InlinePresentationSpec presentationSpec, |
| 104 |
@NonNull @Source String source, |
| 105 |
@Nullable String[] autofillHints, @NonNull @Type String type, boolean isPinned, |
| 106 |
@Nullable InlineSuggestion tooltip) { |
| 107 |
return new InlineSuggestionInfo(presentationSpec, source, autofillHints, type, isPinned, |
| 108 |
tooltip); |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
@android.annotation.StringDef(prefix = "SOURCE_", value = { |
| 130 |
SOURCE_AUTOFILL, |
| 131 |
SOURCE_PLATFORM |
| 132 |
}) |
| 133 |
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) |
| 134 |
@DataClass.Generated.Member |
| 135 |
public @interface Source {} |
| 136 |
|
| 137 |
|
| 138 |
@android.annotation.StringDef(prefix = "TYPE_", value = { |
| 139 |
TYPE_SUGGESTION, |
| 140 |
TYPE_ACTION |
| 141 |
}) |
| 142 |
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) |
| 143 |
@DataClass.Generated.Member |
| 144 |
public @interface Type {} |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
@DataClass.Generated.Member |
| 162 |
public InlineSuggestionInfo( |
| 163 |
@NonNull InlinePresentationSpec inlinePresentationSpec, |
| 164 |
@NonNull @Source String source, |
| 165 |
@Nullable String[] autofillHints, |
| 166 |
@NonNull @Type String type, |
| 167 |
boolean pinned, |
| 168 |
@Nullable InlineSuggestion tooltip) { |
| 169 |
this.mInlinePresentationSpec = inlinePresentationSpec; |
| 170 |
com.android.internal.util.AnnotationValidations.validate( |
| 171 |
NonNull.class, null, mInlinePresentationSpec); |
| 172 |
this.mSource = source; |
| 173 |
|
| 174 |
if (!(java.util.Objects.equals(mSource, SOURCE_AUTOFILL)) |
| 175 |
&& !(java.util.Objects.equals(mSource, SOURCE_PLATFORM))) { |
| 176 |
throw new java.lang.IllegalArgumentException( |
| 177 |
"source was " + mSource + " but must be one of: " |
| 178 |
+ "SOURCE_AUTOFILL(" + SOURCE_AUTOFILL + "), " |
| 179 |
+ "SOURCE_PLATFORM(" + SOURCE_PLATFORM + ")"); |
| 180 |
} |
| 181 |
|
| 182 |
com.android.internal.util.AnnotationValidations.validate( |
| 183 |
NonNull.class, null, mSource); |
| 184 |
this.mAutofillHints = autofillHints; |
| 185 |
this.mType = type; |
| 186 |
|
| 187 |
if (!(java.util.Objects.equals(mType, TYPE_SUGGESTION)) |
| 188 |
&& !(java.util.Objects.equals(mType, TYPE_ACTION))) { |
| 189 |
throw new java.lang.IllegalArgumentException( |
| 190 |
"type was " + mType + " but must be one of: " |
| 191 |
+ "TYPE_SUGGESTION(" + TYPE_SUGGESTION + "), " |
| 192 |
+ "TYPE_ACTION(" + TYPE_ACTION + ")"); |
| 193 |
} |
| 194 |
|
| 195 |
com.android.internal.util.AnnotationValidations.validate( |
| 196 |
NonNull.class, null, mType); |
| 197 |
this.mPinned = pinned; |
| 198 |
this.mTooltip = tooltip; |
| 199 |
|
| 200 |
|
| 201 |
} |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
@DataClass.Generated.Member |
| 207 |
public @NonNull InlinePresentationSpec getInlinePresentationSpec() { |
| 208 |
return mInlinePresentationSpec; |
| 209 |
} |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
@DataClass.Generated.Member |
| 215 |
public @NonNull @Source String getSource() { |
| 216 |
return mSource; |
| 217 |
} |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
@DataClass.Generated.Member |
| 223 |
public @Nullable String[] getAutofillHints() { |
| 224 |
return mAutofillHints; |
| 225 |
} |
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
@DataClass.Generated.Member |
| 231 |
public @NonNull @Type String getType() { |
| 232 |
return mType; |
| 233 |
} |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
@DataClass.Generated.Member |
| 239 |
public boolean isPinned() { |
| 240 |
return mPinned; |
| 241 |
} |
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
@DataClass.Generated.Member |
| 247 |
public @Nullable InlineSuggestion getTooltip() { |
| 248 |
return mTooltip; |
| 249 |
} |
| 250 |
|
| 251 |
@Override |
| 252 |
@DataClass.Generated.Member |
| 253 |
public String toString() { |
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
return "InlineSuggestionInfo { " + |
| 258 |
"inlinePresentationSpec = " + mInlinePresentationSpec + ", " + |
| 259 |
"source = " + mSource + ", " + |
| 260 |
"autofillHints = " + java.util.Arrays.toString(mAutofillHints) + ", " + |
| 261 |
"type = " + mType + ", " + |
| 262 |
"pinned = " + mPinned + ", " + |
| 263 |
"tooltip = " + mTooltip + |
| 264 |
" }"; |
| 265 |
} |
| 266 |
|
| 267 |
@Override |
| 268 |
@DataClass.Generated.Member |
| 269 |
public boolean equals(@Nullable Object o) { |
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
if (this == o) return true; |
| 275 |
if (o == null || getClass() != o.getClass()) return false; |
| 276 |
@SuppressWarnings("unchecked") |
| 277 |
InlineSuggestionInfo that = (InlineSuggestionInfo) o; |
| 278 |
|
| 279 |
return true |
| 280 |
&& java.util.Objects.equals(mInlinePresentationSpec, that.mInlinePresentationSpec) |
| 281 |
&& java.util.Objects.equals(mSource, that.mSource) |
| 282 |
&& java.util.Arrays.equals(mAutofillHints, that.mAutofillHints) |
| 283 |
&& java.util.Objects.equals(mType, that.mType) |
| 284 |
&& mPinned == that.mPinned |
| 285 |
&& java.util.Objects.equals(mTooltip, that.mTooltip); |
| 286 |
} |
| 287 |
|
| 288 |
@Override |
| 289 |
@DataClass.Generated.Member |
| 290 |
public int hashCode() { |
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
int _hash = 1; |
| 295 |
_hash = 31 * _hash + java.util.Objects.hashCode(mInlinePresentationSpec); |
| 296 |
_hash = 31 * _hash + java.util.Objects.hashCode(mSource); |
| 297 |
_hash = 31 * _hash + java.util.Arrays.hashCode(mAutofillHints); |
| 298 |
_hash = 31 * _hash + java.util.Objects.hashCode(mType); |
| 299 |
_hash = 31 * _hash + Boolean.hashCode(mPinned); |
| 300 |
_hash = 31 * _hash + java.util.Objects.hashCode(mTooltip); |
| 301 |
return _hash; |
| 302 |
} |
| 303 |
|
| 304 |
@Override |
| 305 |
@DataClass.Generated.Member |
| 306 |
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { |
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
byte flg = 0; |
| 311 |
if (mPinned) flg |= 0x10; |
| 312 |
if (mAutofillHints != null) flg |= 0x4; |
| 313 |
if (mTooltip != null) flg |= 0x20; |
| 314 |
dest.writeByte(flg); |
| 315 |
dest.writeTypedObject(mInlinePresentationSpec, flags); |
| 316 |
dest.writeString(mSource); |
| 317 |
if (mAutofillHints != null) dest.writeStringArray(mAutofillHints); |
| 318 |
dest.writeString(mType); |
| 319 |
if (mTooltip != null) dest.writeTypedObject(mTooltip, flags); |
| 320 |
} |
| 321 |
|
| 322 |
@Override |
| 323 |
@DataClass.Generated.Member |
| 324 |
public int describeContents() { return 0; } |
| 325 |
|
| 326 |
|
| 327 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 328 |
@DataClass.Generated.Member |
| 329 |
InlineSuggestionInfo(@NonNull android.os.Parcel in) { |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
byte flg = in.readByte(); |
| 334 |
boolean pinned = (flg & 0x10) != 0; |
| 335 |
InlinePresentationSpec inlinePresentationSpec = (InlinePresentationSpec) in.readTypedObject(InlinePresentationSpec.CREATOR); |
| 336 |
String source = in.readString(); |
| 337 |
String[] autofillHints = (flg & 0x4) == 0 ? null : in.createStringArray(); |
| 338 |
String type = in.readString(); |
| 339 |
InlineSuggestion tooltip = (flg & 0x20) == 0 ? null : (InlineSuggestion) in.readTypedObject(InlineSuggestion.CREATOR); |
| 340 |
|
| 341 |
this.mInlinePresentationSpec = inlinePresentationSpec; |
| 342 |
com.android.internal.util.AnnotationValidations.validate( |
| 343 |
NonNull.class, null, mInlinePresentationSpec); |
| 344 |
this.mSource = source; |
| 345 |
|
| 346 |
if (!(java.util.Objects.equals(mSource, SOURCE_AUTOFILL)) |
| 347 |
&& !(java.util.Objects.equals(mSource, SOURCE_PLATFORM))) { |
| 348 |
throw new java.lang.IllegalArgumentException( |
| 349 |
"source was " + mSource + " but must be one of: " |
| 350 |
+ "SOURCE_AUTOFILL(" + SOURCE_AUTOFILL + "), " |
| 351 |
+ "SOURCE_PLATFORM(" + SOURCE_PLATFORM + ")"); |
| 352 |
} |
| 353 |
|
| 354 |
com.android.internal.util.AnnotationValidations.validate( |
| 355 |
NonNull.class, null, mSource); |
| 356 |
this.mAutofillHints = autofillHints; |
| 357 |
this.mType = type; |
| 358 |
|
| 359 |
if (!(java.util.Objects.equals(mType, TYPE_SUGGESTION)) |
| 360 |
&& !(java.util.Objects.equals(mType, TYPE_ACTION))) { |
| 361 |
throw new java.lang.IllegalArgumentException( |
| 362 |
"type was " + mType + " but must be one of: " |
| 363 |
+ "TYPE_SUGGESTION(" + TYPE_SUGGESTION + "), " |
| 364 |
+ "TYPE_ACTION(" + TYPE_ACTION + ")"); |
| 365 |
} |
| 366 |
|
| 367 |
com.android.internal.util.AnnotationValidations.validate( |
| 368 |
NonNull.class, null, mType); |
| 369 |
this.mPinned = pinned; |
| 370 |
this.mTooltip = tooltip; |
| 371 |
|
| 372 |
|
| 373 |
} |
| 374 |
|
| 375 |
@DataClass.Generated.Member |
| 376 |
public static final @NonNull Parcelable.Creator<InlineSuggestionInfo> CREATOR |
| 377 |
= new Parcelable.Creator<InlineSuggestionInfo>() { |
| 378 |
@Override |
| 379 |
public InlineSuggestionInfo[] newArray(int size) { |
| 380 |
return new InlineSuggestionInfo[size]; |
| 381 |
} |
| 382 |
|
| 383 |
@Override |
| 384 |
public InlineSuggestionInfo createFromParcel(@NonNull android.os.Parcel in) { |
| 385 |
return new InlineSuggestionInfo(in); |
| 386 |
} |
| 387 |
}; |
| 388 |
|
| 389 |
@DataClass.Generated( |
| 390 |
time = 1614287616672L, |
| 391 |
codegenVersion = "1.0.22", |
| 392 |
sourceFile = "frameworks/base/core/java/android/view/inputmethod/InlineSuggestionInfo.java", |
| 393 |
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 @android.view.inputmethod.InlineSuggestionInfo.Type java.lang.String TYPE_ACTION\nprivate final @android.annotation.NonNull android.widget.inline.InlinePresentationSpec mInlinePresentationSpec\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\nprivate final @android.annotation.Nullable android.view.inputmethod.InlineSuggestion mTooltip\npublic static @android.annotation.TestApi @android.annotation.NonNull android.view.inputmethod.InlineSuggestionInfo newInlineSuggestionInfo(android.widget.inline.InlinePresentationSpec,java.lang.String,java.lang.String[],java.lang.String,boolean)\npublic static @android.annotation.NonNull android.view.inputmethod.InlineSuggestionInfo newInlineSuggestionInfo(android.widget.inline.InlinePresentationSpec,java.lang.String,java.lang.String[],java.lang.String,boolean,android.view.inputmethod.InlineSuggestion)\nclass InlineSuggestionInfo extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genHiddenConstDefs=true, genHiddenConstructor=true)") |
| 394 |
@Deprecated |
| 395 |
private void __metadata() {} |
| 396 |
|
| 397 |
|
| 398 |
|
| 399 |
|
| 400 |
|
| 401 |
} |