| 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.app.ActivityThread; |
| 22 |
import android.app.compat.CompatChanges; |
| 23 |
import android.compat.annotation.ChangeId; |
| 24 |
import android.compat.annotation.EnabledSince; |
| 25 |
import android.os.Build; |
| 26 |
import android.os.Bundle; |
| 27 |
import android.os.IBinder; |
| 28 |
import android.os.LocaleList; |
| 29 |
import android.os.Parcel; |
| 30 |
import android.os.Parcelable; |
| 31 |
import android.view.Display; |
| 32 |
import android.widget.inline.InlinePresentationSpec; |
| 33 |
|
| 34 |
import com.android.internal.util.DataClass; |
| 35 |
import com.android.internal.util.Preconditions; |
| 36 |
import com.android.internal.widget.InlinePresentationStyleUtils; |
| 37 |
|
| 38 |
import java.util.ArrayList; |
| 39 |
import java.util.List; |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
@DataClass(genEqualsHashCode = true, genToString = true, genBuilder = true) |
| 46 |
public final class InlineSuggestionsRequest implements Parcelable { |
| 47 |
|
| 48 |
|
| 49 |
public static final int SUGGESTION_COUNT_UNLIMITED = Integer.MAX_VALUE; |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
private final int mMaxSuggestionCount; |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
private final @NonNull List<InlinePresentationSpec> mInlinePresentationSpecs; |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
private @NonNull String mHostPackageName; |
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
private @NonNull LocaleList mSupportedLocales; |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
private @NonNull Bundle mExtras; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
private @Nullable IBinder mHostInputToken; |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
private int mHostDisplayId; |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
private @Nullable InlinePresentationSpec mInlineTooltipPresentationSpec; |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
public void setHostInputToken(IBinder hostInputToken) { |
| 118 |
mHostInputToken = hostInputToken; |
| 119 |
} |
| 120 |
|
| 121 |
private boolean extrasEquals(@NonNull Bundle extras) { |
| 122 |
return InlinePresentationStyleUtils.bundleEquals(mExtras, extras); |
| 123 |
} |
| 124 |
|
| 125 |
|
| 126 |
private void parcelHostInputToken(@NonNull Parcel parcel, int flags) { |
| 127 |
parcel.writeStrongBinder(mHostInputToken); |
| 128 |
} |
| 129 |
|
| 130 |
|
| 131 |
private @Nullable IBinder unparcelHostInputToken(Parcel parcel) { |
| 132 |
return parcel.readStrongBinder(); |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
public void setHostDisplayId(int hostDisplayId) { |
| 140 |
mHostDisplayId = hostDisplayId; |
| 141 |
} |
| 142 |
|
| 143 |
private void onConstructed() { |
| 144 |
Preconditions.checkState(!mInlinePresentationSpecs.isEmpty()); |
| 145 |
Preconditions.checkState(mMaxSuggestionCount >= mInlinePresentationSpecs.size()); |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
public void filterContentTypes() { |
| 155 |
InlinePresentationStyleUtils.filterContentTypes(mExtras); |
| 156 |
for (int i = 0; i < mInlinePresentationSpecs.size(); i++) { |
| 157 |
mInlinePresentationSpecs.get(i).filterContentTypes(); |
| 158 |
} |
| 159 |
|
| 160 |
if (mInlineTooltipPresentationSpec != null) { |
| 161 |
mInlineTooltipPresentationSpec.filterContentTypes(); |
| 162 |
} |
| 163 |
} |
| 164 |
|
| 165 |
private static int defaultMaxSuggestionCount() { |
| 166 |
return SUGGESTION_COUNT_UNLIMITED; |
| 167 |
} |
| 168 |
|
| 169 |
private static String defaultHostPackageName() { |
| 170 |
return ActivityThread.currentPackageName(); |
| 171 |
} |
| 172 |
|
| 173 |
private static InlinePresentationSpec defaultInlineTooltipPresentationSpec() { |
| 174 |
return null; |
| 175 |
} |
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
@ChangeId |
| 182 |
@EnabledSince(targetSdkVersion = Build.VERSION_CODES.S) |
| 183 |
private static final long IME_AUTOFILL_DEFAULT_SUPPORTED_LOCALES_IS_EMPTY = 169273070L; |
| 184 |
|
| 185 |
private static LocaleList defaultSupportedLocales() { |
| 186 |
if (CompatChanges.isChangeEnabled(IME_AUTOFILL_DEFAULT_SUPPORTED_LOCALES_IS_EMPTY)) { |
| 187 |
return LocaleList.getEmptyLocaleList(); |
| 188 |
} |
| 189 |
return LocaleList.getDefault(); |
| 190 |
} |
| 191 |
|
| 192 |
@Nullable |
| 193 |
private static IBinder defaultHostInputToken() { |
| 194 |
return null; |
| 195 |
} |
| 196 |
|
| 197 |
@Nullable |
| 198 |
private static int defaultHostDisplayId() { |
| 199 |
return Display.INVALID_DISPLAY; |
| 200 |
} |
| 201 |
|
| 202 |
@NonNull |
| 203 |
private static Bundle defaultExtras() { |
| 204 |
return Bundle.EMPTY; |
| 205 |
} |
| 206 |
|
| 207 |
|
| 208 |
abstract static class BaseBuilder { |
| 209 |
abstract Builder setInlinePresentationSpecs( |
| 210 |
@NonNull List<android.widget.inline.InlinePresentationSpec> specs); |
| 211 |
|
| 212 |
abstract Builder setHostPackageName(@Nullable String value); |
| 213 |
|
| 214 |
abstract Builder setHostInputToken(IBinder hostInputToken); |
| 215 |
|
| 216 |
abstract Builder setHostDisplayId(int value); |
| 217 |
} |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
@DataClass.Generated.Member |
| 235 |
InlineSuggestionsRequest( |
| 236 |
int maxSuggestionCount, |
| 237 |
@NonNull List<InlinePresentationSpec> inlinePresentationSpecs, |
| 238 |
@NonNull String hostPackageName, |
| 239 |
@NonNull LocaleList supportedLocales, |
| 240 |
@NonNull Bundle extras, |
| 241 |
@Nullable IBinder hostInputToken, |
| 242 |
int hostDisplayId, |
| 243 |
@Nullable InlinePresentationSpec inlineTooltipPresentationSpec) { |
| 244 |
this.mMaxSuggestionCount = maxSuggestionCount; |
| 245 |
this.mInlinePresentationSpecs = inlinePresentationSpecs; |
| 246 |
com.android.internal.util.AnnotationValidations.validate( |
| 247 |
NonNull.class, null, mInlinePresentationSpecs); |
| 248 |
this.mHostPackageName = hostPackageName; |
| 249 |
com.android.internal.util.AnnotationValidations.validate( |
| 250 |
NonNull.class, null, mHostPackageName); |
| 251 |
this.mSupportedLocales = supportedLocales; |
| 252 |
com.android.internal.util.AnnotationValidations.validate( |
| 253 |
NonNull.class, null, mSupportedLocales); |
| 254 |
this.mExtras = extras; |
| 255 |
com.android.internal.util.AnnotationValidations.validate( |
| 256 |
NonNull.class, null, mExtras); |
| 257 |
this.mHostInputToken = hostInputToken; |
| 258 |
this.mHostDisplayId = hostDisplayId; |
| 259 |
this.mInlineTooltipPresentationSpec = inlineTooltipPresentationSpec; |
| 260 |
|
| 261 |
onConstructed(); |
| 262 |
} |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
@DataClass.Generated.Member |
| 272 |
public int getMaxSuggestionCount() { |
| 273 |
return mMaxSuggestionCount; |
| 274 |
} |
| 275 |
|
| 276 |
|
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
|
| 281 |
@DataClass.Generated.Member |
| 282 |
public @NonNull List<InlinePresentationSpec> getInlinePresentationSpecs() { |
| 283 |
return mInlinePresentationSpecs; |
| 284 |
} |
| 285 |
|
| 286 |
|
| 287 |
|
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
@DataClass.Generated.Member |
| 292 |
public @NonNull String getHostPackageName() { |
| 293 |
return mHostPackageName; |
| 294 |
} |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
@DataClass.Generated.Member |
| 305 |
public @NonNull LocaleList getSupportedLocales() { |
| 306 |
return mSupportedLocales; |
| 307 |
} |
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
|
| 314 |
|
| 315 |
@DataClass.Generated.Member |
| 316 |
public @NonNull Bundle getExtras() { |
| 317 |
return mExtras; |
| 318 |
} |
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
@DataClass.Generated.Member |
| 327 |
public @Nullable IBinder getHostInputToken() { |
| 328 |
return mHostInputToken; |
| 329 |
} |
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
|
| 337 |
@DataClass.Generated.Member |
| 338 |
public int getHostDisplayId() { |
| 339 |
return mHostDisplayId; |
| 340 |
} |
| 341 |
|
| 342 |
|
| 343 |
|
| 344 |
|
| 345 |
@DataClass.Generated.Member |
| 346 |
public @Nullable InlinePresentationSpec getInlineTooltipPresentationSpec() { |
| 347 |
return mInlineTooltipPresentationSpec; |
| 348 |
} |
| 349 |
|
| 350 |
@Override |
| 351 |
@DataClass.Generated.Member |
| 352 |
public String toString() { |
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
return "InlineSuggestionsRequest { " + |
| 357 |
"maxSuggestionCount = " + mMaxSuggestionCount + ", " + |
| 358 |
"inlinePresentationSpecs = " + mInlinePresentationSpecs + ", " + |
| 359 |
"hostPackageName = " + mHostPackageName + ", " + |
| 360 |
"supportedLocales = " + mSupportedLocales + ", " + |
| 361 |
"extras = " + mExtras + ", " + |
| 362 |
"hostInputToken = " + mHostInputToken + ", " + |
| 363 |
"hostDisplayId = " + mHostDisplayId + ", " + |
| 364 |
"inlineTooltipPresentationSpec = " + mInlineTooltipPresentationSpec + |
| 365 |
" }"; |
| 366 |
} |
| 367 |
|
| 368 |
@Override |
| 369 |
@DataClass.Generated.Member |
| 370 |
public boolean equals(@Nullable Object o) { |
| 371 |
|
| 372 |
|
| 373 |
|
| 374 |
|
| 375 |
if (this == o) return true; |
| 376 |
if (o == null || getClass() != o.getClass()) return false; |
| 377 |
@SuppressWarnings("unchecked") |
| 378 |
InlineSuggestionsRequest that = (InlineSuggestionsRequest) o; |
| 379 |
|
| 380 |
return true |
| 381 |
&& mMaxSuggestionCount == that.mMaxSuggestionCount |
| 382 |
&& java.util.Objects.equals(mInlinePresentationSpecs, that.mInlinePresentationSpecs) |
| 383 |
&& java.util.Objects.equals(mHostPackageName, that.mHostPackageName) |
| 384 |
&& java.util.Objects.equals(mSupportedLocales, that.mSupportedLocales) |
| 385 |
&& extrasEquals(that.mExtras) |
| 386 |
&& java.util.Objects.equals(mHostInputToken, that.mHostInputToken) |
| 387 |
&& mHostDisplayId == that.mHostDisplayId |
| 388 |
&& java.util.Objects.equals(mInlineTooltipPresentationSpec, that.mInlineTooltipPresentationSpec); |
| 389 |
} |
| 390 |
|
| 391 |
@Override |
| 392 |
@DataClass.Generated.Member |
| 393 |
public int hashCode() { |
| 394 |
|
| 395 |
|
| 396 |
|
| 397 |
int _hash = 1; |
| 398 |
_hash = 31 * _hash + mMaxSuggestionCount; |
| 399 |
_hash = 31 * _hash + java.util.Objects.hashCode(mInlinePresentationSpecs); |
| 400 |
_hash = 31 * _hash + java.util.Objects.hashCode(mHostPackageName); |
| 401 |
_hash = 31 * _hash + java.util.Objects.hashCode(mSupportedLocales); |
| 402 |
_hash = 31 * _hash + java.util.Objects.hashCode(mExtras); |
| 403 |
_hash = 31 * _hash + java.util.Objects.hashCode(mHostInputToken); |
| 404 |
_hash = 31 * _hash + mHostDisplayId; |
| 405 |
_hash = 31 * _hash + java.util.Objects.hashCode(mInlineTooltipPresentationSpec); |
| 406 |
return _hash; |
| 407 |
} |
| 408 |
|
| 409 |
@Override |
| 410 |
@DataClass.Generated.Member |
| 411 |
public void writeToParcel(@NonNull Parcel dest, int flags) { |
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
int flg = 0; |
| 416 |
if (mHostInputToken != null) flg |= 0x20; |
| 417 |
if (mInlineTooltipPresentationSpec != null) flg |= 0x80; |
| 418 |
dest.writeInt(flg); |
| 419 |
dest.writeInt(mMaxSuggestionCount); |
| 420 |
dest.writeParcelableList(mInlinePresentationSpecs, flags); |
| 421 |
dest.writeString(mHostPackageName); |
| 422 |
dest.writeTypedObject(mSupportedLocales, flags); |
| 423 |
dest.writeBundle(mExtras); |
| 424 |
parcelHostInputToken(dest, flags); |
| 425 |
dest.writeInt(mHostDisplayId); |
| 426 |
if (mInlineTooltipPresentationSpec != null) dest.writeTypedObject(mInlineTooltipPresentationSpec, flags); |
| 427 |
} |
| 428 |
|
| 429 |
@Override |
| 430 |
@DataClass.Generated.Member |
| 431 |
public int describeContents() { return 0; } |
| 432 |
|
| 433 |
|
| 434 |
@SuppressWarnings({"unchecked", "RedundantCast"}) |
| 435 |
@DataClass.Generated.Member |
| 436 |
InlineSuggestionsRequest(@NonNull Parcel in) { |
| 437 |
|
| 438 |
|
| 439 |
|
| 440 |
int flg = in.readInt(); |
| 441 |
int maxSuggestionCount = in.readInt(); |
| 442 |
List<InlinePresentationSpec> inlinePresentationSpecs = new ArrayList<>(); |
| 443 |
in.readParcelableList(inlinePresentationSpecs, InlinePresentationSpec.class.getClassLoader(), android.widget.inline.InlinePresentationSpec.class); |
| 444 |
String hostPackageName = in.readString(); |
| 445 |
LocaleList supportedLocales = (LocaleList) in.readTypedObject(LocaleList.CREATOR); |
| 446 |
Bundle extras = in.readBundle(); |
| 447 |
IBinder hostInputToken = unparcelHostInputToken(in); |
| 448 |
int hostDisplayId = in.readInt(); |
| 449 |
InlinePresentationSpec inlineTooltipPresentationSpec = (flg & 0x80) == 0 ? null : (InlinePresentationSpec) in.readTypedObject(InlinePresentationSpec.CREATOR); |
| 450 |
|
| 451 |
this.mMaxSuggestionCount = maxSuggestionCount; |
| 452 |
this.mInlinePresentationSpecs = inlinePresentationSpecs; |
| 453 |
com.android.internal.util.AnnotationValidations.validate( |
| 454 |
NonNull.class, null, mInlinePresentationSpecs); |
| 455 |
this.mHostPackageName = hostPackageName; |
| 456 |
com.android.internal.util.AnnotationValidations.validate( |
| 457 |
NonNull.class, null, mHostPackageName); |
| 458 |
this.mSupportedLocales = supportedLocales; |
| 459 |
com.android.internal.util.AnnotationValidations.validate( |
| 460 |
NonNull.class, null, mSupportedLocales); |
| 461 |
this.mExtras = extras; |
| 462 |
com.android.internal.util.AnnotationValidations.validate( |
| 463 |
NonNull.class, null, mExtras); |
| 464 |
this.mHostInputToken = hostInputToken; |
| 465 |
this.mHostDisplayId = hostDisplayId; |
| 466 |
this.mInlineTooltipPresentationSpec = inlineTooltipPresentationSpec; |
| 467 |
|
| 468 |
onConstructed(); |
| 469 |
} |
| 470 |
|
| 471 |
@DataClass.Generated.Member |
| 472 |
public static final @NonNull Parcelable.Creator<InlineSuggestionsRequest> CREATOR |
| 473 |
= new Parcelable.Creator<InlineSuggestionsRequest>() { |
| 474 |
@Override |
| 475 |
public InlineSuggestionsRequest[] newArray(int size) { |
| 476 |
return new InlineSuggestionsRequest[size]; |
| 477 |
} |
| 478 |
|
| 479 |
@Override |
| 480 |
public InlineSuggestionsRequest createFromParcel(@NonNull Parcel in) { |
| 481 |
return new InlineSuggestionsRequest(in); |
| 482 |
} |
| 483 |
}; |
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
@SuppressWarnings("WeakerAccess") |
| 489 |
@DataClass.Generated.Member |
| 490 |
public static final class Builder extends BaseBuilder { |
| 491 |
|
| 492 |
private int mMaxSuggestionCount; |
| 493 |
private @NonNull List<InlinePresentationSpec> mInlinePresentationSpecs; |
| 494 |
private @NonNull String mHostPackageName; |
| 495 |
private @NonNull LocaleList mSupportedLocales; |
| 496 |
private @NonNull Bundle mExtras; |
| 497 |
private @Nullable IBinder mHostInputToken; |
| 498 |
private int mHostDisplayId; |
| 499 |
private @Nullable InlinePresentationSpec mInlineTooltipPresentationSpec; |
| 500 |
|
| 501 |
private long mBuilderFieldsSet = 0L; |
| 502 |
|
| 503 |
|
| 504 |
|
| 505 |
|
| 506 |
|
| 507 |
|
| 508 |
|
| 509 |
|
| 510 |
|
| 511 |
public Builder( |
| 512 |
@NonNull List<InlinePresentationSpec> inlinePresentationSpecs) { |
| 513 |
mInlinePresentationSpecs = inlinePresentationSpecs; |
| 514 |
com.android.internal.util.AnnotationValidations.validate( |
| 515 |
NonNull.class, null, mInlinePresentationSpecs); |
| 516 |
} |
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
|
| 523 |
|
| 524 |
|
| 525 |
@DataClass.Generated.Member |
| 526 |
public @NonNull Builder setMaxSuggestionCount(int value) { |
| 527 |
checkNotUsed(); |
| 528 |
mBuilderFieldsSet |= 0x1; |
| 529 |
mMaxSuggestionCount = value; |
| 530 |
return this; |
| 531 |
} |
| 532 |
|
| 533 |
|
| 534 |
|
| 535 |
|
| 536 |
|
| 537 |
|
| 538 |
@DataClass.Generated.Member |
| 539 |
public @NonNull Builder setInlinePresentationSpecs(@NonNull List<InlinePresentationSpec> value) { |
| 540 |
checkNotUsed(); |
| 541 |
mBuilderFieldsSet |= 0x2; |
| 542 |
mInlinePresentationSpecs = value; |
| 543 |
return this; |
| 544 |
} |
| 545 |
|
| 546 |
|
| 547 |
@DataClass.Generated.Member |
| 548 |
public @NonNull Builder addInlinePresentationSpecs(@NonNull InlinePresentationSpec value) { |
| 549 |
|
| 550 |
|
| 551 |
|
| 552 |
if (mInlinePresentationSpecs == null) setInlinePresentationSpecs(new ArrayList<>()); |
| 553 |
mInlinePresentationSpecs.add(value); |
| 554 |
return this; |
| 555 |
} |
| 556 |
|
| 557 |
|
| 558 |
|
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
@DataClass.Generated.Member |
| 563 |
@Override |
| 564 |
@NonNull Builder setHostPackageName(@NonNull String value) { |
| 565 |
checkNotUsed(); |
| 566 |
mBuilderFieldsSet |= 0x4; |
| 567 |
mHostPackageName = value; |
| 568 |
return this; |
| 569 |
} |
| 570 |
|
| 571 |
|
| 572 |
|
| 573 |
|
| 574 |
|
| 575 |
|
| 576 |
|
| 577 |
|
| 578 |
|
| 579 |
@DataClass.Generated.Member |
| 580 |
public @NonNull Builder setSupportedLocales(@NonNull LocaleList value) { |
| 581 |
checkNotUsed(); |
| 582 |
mBuilderFieldsSet |= 0x8; |
| 583 |
mSupportedLocales = value; |
| 584 |
return this; |
| 585 |
} |
| 586 |
|
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
|
| 592 |
|
| 593 |
@DataClass.Generated.Member |
| 594 |
public @NonNull Builder setExtras(@NonNull Bundle value) { |
| 595 |
checkNotUsed(); |
| 596 |
mBuilderFieldsSet |= 0x10; |
| 597 |
mExtras = value; |
| 598 |
return this; |
| 599 |
} |
| 600 |
|
| 601 |
|
| 602 |
|
| 603 |
|
| 604 |
|
| 605 |
|
| 606 |
|
| 607 |
@DataClass.Generated.Member |
| 608 |
@Override |
| 609 |
@NonNull Builder setHostInputToken(@NonNull IBinder value) { |
| 610 |
checkNotUsed(); |
| 611 |
mBuilderFieldsSet |= 0x20; |
| 612 |
mHostInputToken = value; |
| 613 |
return this; |
| 614 |
} |
| 615 |
|
| 616 |
|
| 617 |
|
| 618 |
|
| 619 |
|
| 620 |
|
| 621 |
|
| 622 |
@DataClass.Generated.Member |
| 623 |
@Override |
| 624 |
@NonNull Builder setHostDisplayId(int value) { |
| 625 |
checkNotUsed(); |
| 626 |
mBuilderFieldsSet |= 0x40; |
| 627 |
mHostDisplayId = value; |
| 628 |
return this; |
| 629 |
} |
| 630 |
|
| 631 |
|
| 632 |
|
| 633 |
|
| 634 |
@DataClass.Generated.Member |
| 635 |
public @NonNull Builder setInlineTooltipPresentationSpec(@NonNull InlinePresentationSpec value) { |
| 636 |
checkNotUsed(); |
| 637 |
mBuilderFieldsSet |= 0x80; |
| 638 |
mInlineTooltipPresentationSpec = value; |
| 639 |
return this; |
| 640 |
} |
| 641 |
|
| 642 |
|
| 643 |
public @NonNull InlineSuggestionsRequest build() { |
| 644 |
checkNotUsed(); |
| 645 |
mBuilderFieldsSet |= 0x100; |
| 646 |
|
| 647 |
if ((mBuilderFieldsSet & 0x1) == 0) { |
| 648 |
mMaxSuggestionCount = defaultMaxSuggestionCount(); |
| 649 |
} |
| 650 |
if ((mBuilderFieldsSet & 0x4) == 0) { |
| 651 |
mHostPackageName = defaultHostPackageName(); |
| 652 |
} |
| 653 |
if ((mBuilderFieldsSet & 0x8) == 0) { |
| 654 |
mSupportedLocales = defaultSupportedLocales(); |
| 655 |
} |
| 656 |
if ((mBuilderFieldsSet & 0x10) == 0) { |
| 657 |
mExtras = defaultExtras(); |
| 658 |
} |
| 659 |
if ((mBuilderFieldsSet & 0x20) == 0) { |
| 660 |
mHostInputToken = defaultHostInputToken(); |
| 661 |
} |
| 662 |
if ((mBuilderFieldsSet & 0x40) == 0) { |
| 663 |
mHostDisplayId = defaultHostDisplayId(); |
| 664 |
} |
| 665 |
if ((mBuilderFieldsSet & 0x80) == 0) { |
| 666 |
mInlineTooltipPresentationSpec = defaultInlineTooltipPresentationSpec(); |
| 667 |
} |
| 668 |
InlineSuggestionsRequest o = new InlineSuggestionsRequest( |
| 669 |
mMaxSuggestionCount, |
| 670 |
mInlinePresentationSpecs, |
| 671 |
mHostPackageName, |
| 672 |
mSupportedLocales, |
| 673 |
mExtras, |
| 674 |
mHostInputToken, |
| 675 |
mHostDisplayId, |
| 676 |
mInlineTooltipPresentationSpec); |
| 677 |
return o; |
| 678 |
} |
| 679 |
|
| 680 |
private void checkNotUsed() { |
| 681 |
if ((mBuilderFieldsSet & 0x100) != 0) { |
| 682 |
throw new IllegalStateException( |
| 683 |
"This Builder should not be reused. Use a new Builder instance instead"); |
| 684 |
} |
| 685 |
} |
| 686 |
} |
| 687 |
|
| 688 |
@DataClass.Generated( |
| 689 |
time = 1621415989607L, |
| 690 |
codegenVersion = "1.0.23", |
| 691 |
sourceFile = "frameworks/base/core/java/android/view/inputmethod/InlineSuggestionsRequest.java", |
| 692 |
inputSignatures = "public static final int SUGGESTION_COUNT_UNLIMITED\nprivate final int mMaxSuggestionCount\nprivate final @android.annotation.NonNull java.util.List<android.widget.inline.InlinePresentationSpec> mInlinePresentationSpecs\nprivate @android.annotation.NonNull java.lang.String mHostPackageName\nprivate @android.annotation.NonNull android.os.LocaleList mSupportedLocales\nprivate @android.annotation.NonNull android.os.Bundle mExtras\nprivate @android.annotation.Nullable android.os.IBinder mHostInputToken\nprivate int mHostDisplayId\nprivate @android.annotation.Nullable android.widget.inline.InlinePresentationSpec mInlineTooltipPresentationSpec\nprivate static final @android.compat.annotation.ChangeId @android.compat.annotation.EnabledSince long IME_AUTOFILL_DEFAULT_SUPPORTED_LOCALES_IS_EMPTY\npublic void setHostInputToken(android.os.IBinder)\nprivate boolean extrasEquals(android.os.Bundle)\nprivate void parcelHostInputToken(android.os.Parcel,int)\nprivate @android.annotation.Nullable android.os.IBinder unparcelHostInputToken(android.os.Parcel)\npublic void setHostDisplayId(int)\nprivate void onConstructed()\npublic void filterContentTypes()\nprivate static int defaultMaxSuggestionCount()\nprivate static java.lang.String defaultHostPackageName()\nprivate static android.widget.inline.InlinePresentationSpec defaultInlineTooltipPresentationSpec()\nprivate static android.os.LocaleList defaultSupportedLocales()\nprivate static @android.annotation.Nullable android.os.IBinder defaultHostInputToken()\nprivate static @android.annotation.Nullable int defaultHostDisplayId()\nprivate static @android.annotation.NonNull android.os.Bundle defaultExtras()\nclass InlineSuggestionsRequest extends java.lang.Object implements [android.os.Parcelable]\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genToString=true, genBuilder=true)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setInlinePresentationSpecs(java.util.List<android.widget.inline.InlinePresentationSpec>)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostPackageName(java.lang.String)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostInputToken(android.os.IBinder)\nabstract android.view.inputmethod.InlineSuggestionsRequest.Builder setHostDisplayId(int)\nclass BaseBuilder extends java.lang.Object implements []") |
| 693 |
@Deprecated |
| 694 |
private void __metadata() {} |
| 695 |
|
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
|
| 700 |
} |