| 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.IntDef; |
| 20 |
import android.annotation.NonNull; |
| 21 |
import android.annotation.Nullable; |
| 22 |
import android.content.IntentSender; |
| 23 |
import android.os.Bundle; |
| 24 |
import android.os.Parcel; |
| 25 |
import android.os.Parcelable; |
| 26 |
import android.view.View; |
| 27 |
import android.view.inputmethod.InlineSuggestionsRequest; |
| 28 |
|
| 29 |
import com.android.internal.util.DataClass; |
| 30 |
import com.android.internal.util.Preconditions; |
| 31 |
|
| 32 |
import java.lang.annotation.Retention; |
| 33 |
import java.lang.annotation.RetentionPolicy; |
| 34 |
import java.util.ArrayList; |
| 35 |
import java.util.List; |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
@DataClass( |
| 46 |
genToString = true, |
| 47 |
genHiddenConstructor = true, |
| 48 |
genHiddenConstDefs = true) |
| 49 |
public final class FillRequest implements Parcelable { |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
public static final @RequestFlags int FLAG_MANUAL_REQUEST = 0x1; |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
public static final @RequestFlags int FLAG_COMPATIBILITY_MODE_REQUEST = 0x2; |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
public static final @RequestFlags int FLAG_PASSWORD_INPUT_TYPE = 0x4; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
public static final @RequestFlags int FLAG_VIEW_NOT_FOCUSED = 0x10; |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
public static final @RequestFlags int FLAG_SUPPORTS_FILL_DIALOG = 0x40; |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
public static final @RequestFlags int FLAG_IME_SHOWING = 0x80; |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
public static final @RequestFlags int FLAG_RESET_FILL_DIALOG_STATE = 0x100; |
| 119 |
|
| 120 |
|
| 121 |
public static final int INVALID_REQUEST_ID = Integer.MIN_VALUE; |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
private final int mId; |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
private final @NonNull List<FillContext> mFillContexts; |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
private final @Nullable Bundle mClientState; |
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
private final @RequestFlags int mFlags; |
| 161 |
|
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
|
| 168 |
|
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
|
| 176 |
private final @Nullable InlineSuggestionsRequest mInlineSuggestionsRequest; |
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
private final @Nullable IntentSender mDelayedFillIntentSender; |
| 190 |
|
| 191 |
private void onConstructed() { |
| 192 |
Preconditions.checkCollectionElementsNotNull(mFillContexts, "contexts"); |
| 193 |
} |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
@IntDef(flag = true, prefix = "FLAG_", value = { |
| 212 |
FLAG_MANUAL_REQUEST, |
| 213 |
FLAG_COMPATIBILITY_MODE_REQUEST, |
| 214 |
FLAG_PASSWORD_INPUT_TYPE, |
| 215 |
FLAG_VIEW_NOT_FOCUSED, |
| 216 |
FLAG_SUPPORTS_FILL_DIALOG, |
| 217 |
FLAG_IME_SHOWING, |
| 218 |
FLAG_RESET_FILL_DIALOG_STATE |
| 219 |
}) |
| 220 |
@Retention(RetentionPolicy.SOURCE) |
| 221 |
@DataClass.Generated.Member |
| 222 |
public @interface RequestFlags {} |
| 223 |
|
| 224 |
|
| 225 |
@DataClass.Generated.Member |
| 226 |
public static String requestFlagsToString(@RequestFlags int value) { |
| 227 |
return com.android.internal.util.BitUtils.flagsToString( |
| 228 |
value, FillRequest::singleRequestFlagsToString); |
| 229 |
} |
| 230 |
|
| 231 |
@DataClass.Generated.Member |
| 232 |
static String singleRequestFlagsToString(@RequestFlags int value) { |
| 233 |
switch (value) { |
| 234 |
case FLAG_MANUAL_REQUEST: |
| 235 |
return "FLAG_MANUAL_REQUEST"; |
| 236 |
case FLAG_COMPATIBILITY_MODE_REQUEST: |
| 237 |
return "FLAG_COMPATIBILITY_MODE_REQUEST"; |
| 238 |
case FLAG_PASSWORD_INPUT_TYPE: |
| 239 |
return "FLAG_PASSWORD_INPUT_TYPE"; |
| 240 |
case FLAG_VIEW_NOT_FOCUSED: |
| 241 |
return "FLAG_VIEW_NOT_FOCUSED"; |
| 242 |
case FLAG_SUPPORTS_FILL_DIALOG: |
| 243 |
return "FLAG_SUPPORTS_FILL_DIALOG"; |
| 244 |
case FLAG_IME_SHOWING: |
| 245 |
return "FLAG_IME_SHOWING"; |
| 246 |
case FLAG_RESET_FILL_DIALOG_STATE: |
| 247 |
return "FLAG_RESET_FILL_DIALOG_STATE"; |
| 248 |
default: return Integer.toHexString(value); |
| 249 |
} |
| 250 |
} |
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
@DataClass.Generated.Member |
| 303 |
public FillRequest( |
| 304 |
int id, |
| 305 |
@NonNull List<FillContext> fillContexts, |
| 306 |
@Nullable Bundle clientState, |
| 307 |
@RequestFlags int flags, |
| 308 |
@Nullable InlineSuggestionsRequest inlineSuggestionsRequest, |
| 309 |
@Nullable IntentSender delayedFillIntentSender) { |
| 310 |
this.mId = id; |
| 311 |
this.mFillContexts = fillContexts; |
| 312 |
com.android.internal.util.AnnotationValidations.validate( |
| 313 |
NonNull.class, null, mFillContexts); |
| 314 |
this.mClientState = clientState; |
| 315 |
this.mFlags = flags; |
| 316 |
|
| 317 |
Preconditions.checkFlagsArgument( |
| 318 |
mFlags, |
| 319 |
FLAG_MANUAL_REQUEST |
| 320 |
| FLAG_COMPATIBILITY_MODE_REQUEST |
| 321 |
| FLAG_PASSWORD_INPUT_TYPE |
| 322 |
| FLAG_VIEW_NOT_FOCUSED |
| 323 |
| FLAG_SUPPORTS_FILL_DIALOG |
| 324 |
| FLAG_IME_SHOWING |
| 325 |
| FLAG_RESET_FILL_DIALOG_STATE); |
| 326 |
this.mInlineSuggestionsRequest = inlineSuggestionsRequest; |
| 327 |
this.mDelayedFillIntentSender = delayedFillIntentSender; |
| 328 |
|
| 329 |
onConstructed(); |
| 330 |
} |
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
@DataClass.Generated.Member |
| 336 |
public int getId() { |
| 337 |
return mId; |
| 338 |
} |
| 339 |
|
| 340 |
|
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
@DataClass.Generated.Member |
| 348 |
public @NonNull List<FillContext> getFillContexts() { |
| 349 |
return mFillContexts; |
| 350 |
} |
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
@DataClass.Generated.Member |
| 366 |
public @Nullable Bundle getClientState() { |
| 367 |
return mClientState; |
| 368 |
} |
| 369 |
|
| 370 |
|
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
|
| 376 |
|
| 377 |
@DataClass.Generated.Member |
| 378 |
public @RequestFlags int getFlags() { |
| 379 |
return mFlags; |
| 380 |
} |
| 381 |
|
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
|
| 388 |
|
| 389 |
|
| 390 |
|
| 391 |
|
| 392 |
|
| 393 |
|
| 394 |
|
| 395 |
|
| 396 |
@DataClass.Generated.Member |
| 397 |
public @Nullable InlineSuggestionsRequest getInlineSuggestionsRequest() { |
| 398 |
return mInlineSuggestionsRequest; |
| 399 |
} |
| 400 |
|
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
|
| 405 |
|
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
@DataClass.Generated.Member |
| 413 |
public @Nullable IntentSender getDelayedFillIntentSender() { |
| 414 |
return mDelayedFillIntentSender; |
| 415 |
} |
| 416 |
|
| 417 |
@Override |
| 418 |
@DataClass.Generated.Member |
| 419 |
public String toString() { |
| 420 |
|
| 421 |
|
| 422 |
|
| 423 |
return "FillRequest { " + |
| 424 |
"id = " + mId + ", " + |
| 425 |
"fillContexts = " + mFillContexts + ", " + |
| 426 |
"clientState = " + mClientState + ", " + |
| 427 |
"flags = " + requestFlagsToString(mFlags) + ", " + |
| 428 |
"inlineSuggestionsRequest = " + mInlineSuggestionsRequest + ", " + |
| 429 |
"delayedFillIntentSender = " + mDelayedFillIntentSender + |
| 430 |
" }"; |
| 431 |
} |
| 432 |
|
| 433 |
@Override |
| 434 |
@DataClass.Generated.Member |
| 435 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 436 |
|
| 437 |
|
| 438 |
|
| 439 |
byte flg = 0; |
| 440 |
if (mClientState != null) flg |= 0x4; |
| 441 |
if (mInlineSuggestionsRequest != null) flg |= 0x10; |
| 442 |
if (mDelayedFillIntentSender != null) flg |= 0x20; |
| 443 |
dest.writeByte(flg); |
| 444 |
dest.writeInt(mId); |
| 445 |
dest.writeParcelableList(mFillContexts, flags); |
| 446 |
if (mClientState != null) dest.writeBundle(mClientState); |
| 447 |
dest.writeInt(mFlags); |
| 448 |
if (mInlineSuggestionsRequest != null) dest.writeTypedObject(mInlineSuggestionsRequest, flags); |
| 449 |
if (mDelayedFillIntentSender != null) dest.writeTypedObject(mDelayedFillIntentSender, flags); |
| 450 |
} |
| 451 |
|
| 452 |
@Override |
| 453 |
@DataClass.Generated.Member |
| 454 |
public int describeContents() { return 0; } |
| 455 |
|
| 456 |
|
| 457 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 458 |
@DataClass.Generated.Member |
| 459 |
FillRequest(@NonNull Parcel in) { |
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
byte flg = in.readByte(); |
| 464 |
int id = in.readInt(); |
| 465 |
List<FillContext> fillContexts = new ArrayList<>(); |
| 466 |
in.readParcelableList(fillContexts, FillContext.class.getClassLoader()); |
| 467 |
Bundle clientState = (flg & 0x4) == 0 ? null : in.readBundle(); |
| 468 |
int flags = in.readInt(); |
| 469 |
InlineSuggestionsRequest inlineSuggestionsRequest = (flg & 0x10) == 0 ? null : (InlineSuggestionsRequest) in.readTypedObject(InlineSuggestionsRequest.CREATOR); |
| 470 |
IntentSender delayedFillIntentSender = (flg & 0x20) == 0 ? null : (IntentSender) in.readTypedObject(IntentSender.CREATOR); |
| 471 |
|
| 472 |
this.mId = id; |
| 473 |
this.mFillContexts = fillContexts; |
| 474 |
com.android.internal.util.AnnotationValidations.validate( |
| 475 |
NonNull.class, null, mFillContexts); |
| 476 |
this.mClientState = clientState; |
| 477 |
this.mFlags = flags; |
| 478 |
|
| 479 |
Preconditions.checkFlagsArgument( |
| 480 |
mFlags, |
| 481 |
FLAG_MANUAL_REQUEST |
| 482 |
| FLAG_COMPATIBILITY_MODE_REQUEST |
| 483 |
| FLAG_PASSWORD_INPUT_TYPE |
| 484 |
| FLAG_VIEW_NOT_FOCUSED |
| 485 |
| FLAG_SUPPORTS_FILL_DIALOG |
| 486 |
| FLAG_IME_SHOWING |
| 487 |
| FLAG_RESET_FILL_DIALOG_STATE); |
| 488 |
this.mInlineSuggestionsRequest = inlineSuggestionsRequest; |
| 489 |
this.mDelayedFillIntentSender = delayedFillIntentSender; |
| 490 |
|
| 491 |
onConstructed(); |
| 492 |
} |
| 493 |
|
| 494 |
@DataClass.Generated.Member |
| 495 |
public static final @NonNull Parcelable.Creator<FillRequest> CREATOR |
| 496 |
= new Parcelable.Creator<FillRequest>() { |
| 497 |
@Override |
| 498 |
public FillRequest[] newArray(int size) { |
| 499 |
return new FillRequest[size]; |
| 500 |
} |
| 501 |
|
| 502 |
@Override |
| 503 |
public FillRequest createFromParcel(@NonNull Parcel in) { |
| 504 |
return new FillRequest(in); |
| 505 |
} |
| 506 |
}; |
| 507 |
|
| 508 |
@DataClass.Generated( |
| 509 |
time = 1663290803064L, |
| 510 |
codegenVersion = "1.0.23", |
| 511 |
sourceFile = "frameworks/base/core/java/android/service/autofill/FillRequest.java", |
| 512 |
inputSignatures = "public static final @android.service.autofill.FillRequest.RequestFlags int FLAG_MANUAL_REQUEST\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_COMPATIBILITY_MODE_REQUEST\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_PASSWORD_INPUT_TYPE\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_VIEW_NOT_FOCUSED\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_SUPPORTS_FILL_DIALOG\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_IME_SHOWING\npublic static final @android.service.autofill.FillRequest.RequestFlags int FLAG_RESET_FILL_DIALOG_STATE\npublic static final int INVALID_REQUEST_ID\nprivate final int mId\nprivate final @android.annotation.NonNull java.util.List<android.service.autofill.FillContext> mFillContexts\nprivate final @android.annotation.Nullable android.os.Bundle mClientState\nprivate final @android.service.autofill.FillRequest.RequestFlags int mFlags\nprivate final @android.annotation.Nullable android.view.inputmethod.InlineSuggestionsRequest mInlineSuggestionsRequest\nprivate final @android.annotation.Nullable android.content.IntentSender mDelayedFillIntentSender\nprivate void onConstructed()\nclass FillRequest extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genHiddenConstructor=true, genHiddenConstDefs=true)") |
| 513 |
@Deprecated |
| 514 |
private void __metadata() {} |
| 515 |
|
| 516 |
|
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
} |