public final class

HintConstants

extends java.lang.Object

 java.lang.Object

↳androidx.autofill.HintConstants

Gradle dependencies

compile group: 'androidx.autofill', name: 'autofill', version: '1.3.0-alpha01'

  • groupId: androidx.autofill
  • artifactId: autofill
  • version: 1.3.0-alpha01

Artifact androidx.autofill:autofill:1.3.0-alpha01 it located at Google repository (https://maven.google.com/)

Overview

Contains all the officially supported autofill hint constants.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_EMAIL_ADDRESS) or android.view.View.

Summary

Fields
public static final java.lang.StringAUTOFILL_HINT_2FA_APP_OTP

Hint indicating that this view can be autofilled with an Time-Based One Time Password (OTP) generated by 2FA apps.

public static final java.lang.StringAUTOFILL_HINT_BIRTH_DATE_DAY

Hint indicating that this view can be autofilled with a birth day(of the month).

public static final java.lang.StringAUTOFILL_HINT_BIRTH_DATE_FULL

Hint indicating that this view can be autofilled with a full birth date.

public static final java.lang.StringAUTOFILL_HINT_BIRTH_DATE_MONTH

Hint indicating that this view can be autofilled with a birth month.

public static final java.lang.StringAUTOFILL_HINT_BIRTH_DATE_YEAR

Hint indicating that this view can be autofilled with a birth year.

public static final java.lang.StringAUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE

Hint indicating that this view can be autofilled with a credit card expiration date.

public static final java.lang.StringAUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY

Hint indicating that this view can be autofilled with a credit card expiration day.

public static final java.lang.StringAUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH

Hint indicating that this view can be autofilled with a credit card expiration month.

public static final java.lang.StringAUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR

Hint indicating that this view can be autofilled with a credit card expiration year.

public static final java.lang.StringAUTOFILL_HINT_CREDIT_CARD_NUMBER

Hint indicating that this view can be autofilled with a credit card number.

public static final java.lang.StringAUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE

Hint indicating that this view can be autofilled with a credit card security code.

public static final java.lang.StringAUTOFILL_HINT_EMAIL_ADDRESS

Hint indicating that this view can be autofilled with an email address.

public static final java.lang.StringAUTOFILL_HINT_EMAIL_OTP

Hint indicating that this view can be autofilled with an Email One Time Password (OTP).

public static final java.lang.StringAUTOFILL_HINT_FLIGHT_CONFIRMATION_CODE

Hint indicating that this view can be autofilled with a flight confirmation code.

public static final java.lang.StringAUTOFILL_HINT_FLIGHT_NUMBER

Hint indicating that this view can be autofilled with a flight number.

public static final java.lang.StringAUTOFILL_HINT_GENDER

Hint indicating that this view can be autofilled with a gender.

public static final java.lang.StringAUTOFILL_HINT_GIFT_CARD_NUMBER

Hint indicating that this view can be autofilled with a gift card code.

public static final java.lang.StringAUTOFILL_HINT_GIFT_CARD_PIN

Hint indicating that this view can be autofilled with a gift card pin.

public static final java.lang.StringAUTOFILL_HINT_LOYALTY_ACCOUNT_NUMBER

Hint indicating that this view can be autofilled with a loyalty number.

public static final java.lang.StringAUTOFILL_HINT_NAME

Hint indicating that this view can be autofilled with a user's real name.

public static final java.lang.StringAUTOFILL_HINT_NEW_PASSWORD

Hint indicating that this view can be interpreted as a newly created password for save/update.

public static final java.lang.StringAUTOFILL_HINT_NEW_USERNAME

Hint indicating that this view can be interpreted as a newly created username for save/update.

public static final java.lang.StringAUTOFILL_HINT_NOT_APPLICABLE

Hint indicating that this view is not eligible for autofill.

public static final java.lang.StringAUTOFILL_HINT_PASSWORD

Hint indicating that this view can be autofilled with a password.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME

Hint indicating that this view can be autofilled with a person's full name.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME_FAMILY

Hint indicating that this view can be autofilled with a person's last/family name.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME_GIVEN

Hint indicating that this view can be autofilled with a person's first/given name.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME_MIDDLE

Hint indicating that this view can be autofilled with a person's middle name.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME_MIDDLE_INITIAL

Hint indicating that this view can be autofilled with a person's middle initial.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME_PREFIX

Hint indicating that this view can be autofilled with a person's name prefix.

public static final java.lang.StringAUTOFILL_HINT_PERSON_NAME_SUFFIX

Hint indicating that this view can be autofilled with a person's name suffix.

public static final java.lang.StringAUTOFILL_HINT_PHONE

Hint indicating that this view can be autofilled with a phone number.

public static final java.lang.StringAUTOFILL_HINT_PHONE_COUNTRY_CODE

Hint indicating that this view can be autofilled with a phone number's country code.

public static final java.lang.StringAUTOFILL_HINT_PHONE_NATIONAL

Hint indicating that this view can be autofilled with a phone number without country code.

public static final java.lang.StringAUTOFILL_HINT_PHONE_NUMBER

Hint indicating that this view can be autofilled with the user's full phone number with country code.

public static final java.lang.StringAUTOFILL_HINT_PHONE_NUMBER_DEVICE

Hint indicating that this view can be autofilled with the current device's phone number usually for Sign Up / OTP flows.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS

Hint indicating that this view can be autofilled with a postal address.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_APT_NUMBER

Hint indicating that this view can be autofilled with an apartment/room/suite number.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_COUNTRY

Hint indicating that this view can be autofilled with a country name/code.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_DEPENDENT_LOCALITY

Hint indicating that this view can be autofilled with a dependent locality i.e.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_ADDRESS

Hint indicating that this view can be autofilled with auxiliary address details.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_POSTAL_CODE

Hint indicating that this view can be autofilled with an extended ZIP/POSTAL code.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_LOCALITY

Hint indicating that this view can be autofilled with an address locality (city/town).

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_REGION

Hint indicating that this view can be autofilled with a region/state.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_ADDRESS_STREET_ADDRESS

Hint indicating that this view can be autofilled with a street address.

public static final java.lang.StringAUTOFILL_HINT_POSTAL_CODE

Hint indicating that this view can be autofilled with a postal code.

public static final java.lang.StringAUTOFILL_HINT_PROMO_CODE

Hint indicating that this view can be autofilled with a promo/coupon code.

public static final java.lang.StringAUTOFILL_HINT_SMS_OTP

Hint indicating that this view can be autofilled with a SMS One Time Password (OTP).

public static final java.lang.StringAUTOFILL_HINT_UPI_VPA

Hint indicating that this view can be autofilled with an Unified Payments Interface (UPI) Virtual Payment Address.

public static final java.lang.StringAUTOFILL_HINT_USERNAME

Hint indicating that this view can be autofilled with a username.

public static final java.lang.StringAUTOFILL_HINT_WIFI_PASSWORD

Hint indicating that this view can be autofilled with a wifi password.

Methods
public static java.lang.StringgenerateSmsOtpHintForCharacterPosition(int characterPosition)

Generates the corresponding hint that indicates that this view can be autofilled with the characterPosition'th character/digit of a SMS One Time Password (OTP).

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final java.lang.String AUTOFILL_HINT_EMAIL_ADDRESS

Hint indicating that this view can be autofilled with an email address.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_EMAIL_ADDRESS).

See android.view.View for more info about autofill hints.3

public static final java.lang.String AUTOFILL_HINT_NAME

Deprecated: replaced by #AUTOFILL_HINT_PERSON_NAME to be more specific

Hint indicating that this view can be autofilled with a user's real name.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_NAME).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_USERNAME

Hint indicating that this view can be autofilled with a username.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_USERNAME).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PASSWORD

Hint indicating that this view can be autofilled with a password.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PASSWORD).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_WIFI_PASSWORD

Hint indicating that this view can be autofilled with a wifi password.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_WIFI_PASSWORD).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PHONE

Deprecated: replaced by #AUTOFILL_HINT_PHONE_NUMBER to be more specific

Hint indicating that this view can be autofilled with a phone number.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PHONE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS

Hint indicating that this view can be autofilled with a postal address.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_CODE

Hint indicating that this view can be autofilled with a postal code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_CODE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_NUMBER

Hint indicating that this view can be autofilled with a credit card number.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_CREDIT_CARD_NUMBER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE

Hint indicating that this view can be autofilled with a credit card security code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE

Hint indicating that this view can be autofilled with a credit card expiration date.

It should be used when the credit card expiration date is represented by just one view; if it is represented by more than one (for example, one view for the month and another view for the year), then each of these views should use the hint specific for the unit (HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, or HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR).

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE).

When annotating a view with this hint, it's recommended to use a date autofill value to avoid ambiguity when the autofill service provides a value for it. To understand why a value can be ambiguous, consider "April of 2020", which could be represented as either of the following options:

  • "04/2020"
  • "4/2020"
  • "2020/04"
  • "2020/4"
  • "April/2020"
  • "Apr/2020"

You define a date autofill value for the view by overriding the following methods:

  1. android.view.View to return android.view.View.
  2. android.view.View to return a .
  3. android.view.View to expect a data autofillvalue.

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH

Hint indicating that this view can be autofilled with a credit card expiration month.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH).

When annotating a view with this hint, it's recommended to use a text autofill value whose value is the numerical representation of the month, starting on 1 to avoid ambiguity when the autofill service provides a value for it. To understand why a value can be ambiguous, consider "January", which could be represented as either of

  • "1": recommended way.
  • "0": if following the MONTH convention.
  • "January": full name, in English.
  • "jan": abbreviated name, in English.
  • "Janeiro": full name, in another language.

Another recommended approach is to use a date autofill value - see HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE for more details.

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR

Hint indicating that this view can be autofilled with a credit card expiration year.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY

Hint indicating that this view can be autofilled with a credit card expiration day.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_COUNTRY

Hint indicating that this view can be autofilled with a country name/code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_COUNTRY).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_REGION

Hint indicating that this view can be autofilled with a region/state.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_REGION).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_LOCALITY

Hint indicating that this view can be autofilled with an address locality (city/town).

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_LOCALITY).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_STREET_ADDRESS

Hint indicating that this view can be autofilled with a street address.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_STREET_ADDRESS).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_ADDRESS

Hint indicating that this view can be autofilled with auxiliary address details.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_ADDRESS).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_POSTAL_CODE

Hint indicating that this view can be autofilled with an extended ZIP/POSTAL code.

Example: In forms that split the U.S. ZIP+4 Code with nine digits 99999-9999 into two fields annotate the delivery route code with this hint.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_POSTAL_CODE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_APT_NUMBER

Hint indicating that this view can be autofilled with an apartment/room/suite number.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_APT_NUMBER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_POSTAL_ADDRESS_DEPENDENT_LOCALITY

Hint indicating that this view can be autofilled with a dependent locality i.e. district/locality division/postal division/suburb etc.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_POSTAL_ADDRESS_DEPENDENT_LOCALITY).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME

Hint indicating that this view can be autofilled with a person's full name.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME_GIVEN

Hint indicating that this view can be autofilled with a person's first/given name.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME_GIVEN).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME_FAMILY

Hint indicating that this view can be autofilled with a person's last/family name.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME_FAMILY).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME_MIDDLE

Hint indicating that this view can be autofilled with a person's middle name.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME_MIDDLE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME_MIDDLE_INITIAL

Hint indicating that this view can be autofilled with a person's middle initial.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME_MIDDLE_INITIAL).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME_PREFIX

Hint indicating that this view can be autofilled with a person's name prefix.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME_PREFIX).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PERSON_NAME_SUFFIX

Hint indicating that this view can be autofilled with a person's name suffix.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PERSON_NAME_SUFFIX).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PHONE_NUMBER

Hint indicating that this view can be autofilled with the user's full phone number with country code.

Example: +1 123-456-7890

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PHONE_NUMBER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PHONE_NUMBER_DEVICE

Hint indicating that this view can be autofilled with the current device's phone number usually for Sign Up / OTP flows.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PHONE_NUMBER_DEVICE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PHONE_COUNTRY_CODE

Hint indicating that this view can be autofilled with a phone number's country code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PHONE_COUNTRY_CODE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PHONE_NATIONAL

Hint indicating that this view can be autofilled with a phone number without country code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PHONE_NATIONAL).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_NEW_USERNAME

Hint indicating that this view can be interpreted as a newly created username for save/update.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_NEW_USERNAME).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_NEW_PASSWORD

Hint indicating that this view can be interpreted as a newly created password for save/update.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_NEW_PASSWORD).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_GENDER

Hint indicating that this view can be autofilled with a gender.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_GENDER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_BIRTH_DATE_FULL

Hint indicating that this view can be autofilled with a full birth date.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_BIRTH_DATE_FULL).

The recommended approach is to use a date autofill value - see HintConstants.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE for more details.

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_BIRTH_DATE_DAY

Hint indicating that this view can be autofilled with a birth day(of the month).

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_BIRTH_DATE_DAY).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_BIRTH_DATE_MONTH

Hint indicating that this view can be autofilled with a birth month.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_BIRTH_DATE_MONTH).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_BIRTH_DATE_YEAR

Hint indicating that this view can be autofilled with a birth year.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_BIRTH_DATE_YEAR).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_SMS_OTP

Hint indicating that this view can be autofilled with a SMS One Time Password (OTP).

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_SMS_OTP).

When annotating OTP code fields which map to a single digit of the code consider using HintConstants.generateSmsOtpHintForCharacterPosition(int)

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_EMAIL_OTP

Hint indicating that this view can be autofilled with an Email One Time Password (OTP).

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_EMAIL_OTP).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_2FA_APP_OTP

Hint indicating that this view can be autofilled with an Time-Based One Time Password (OTP) generated by 2FA apps.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_2FA_APP_OTP).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_NOT_APPLICABLE

Hint indicating that this view is not eligible for autofill.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_NOT_APPLICABLE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_PROMO_CODE

Hint indicating that this view can be autofilled with a promo/coupon code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_PROMO_CODE).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_UPI_VPA

Hint indicating that this view can be autofilled with an Unified Payments Interface (UPI) Virtual Payment Address.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_UPI_VPA).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_LOYALTY_ACCOUNT_NUMBER

Hint indicating that this view can be autofilled with a loyalty number.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_LOYALTY_ACCOUNT_NUMBER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_GIFT_CARD_NUMBER

Hint indicating that this view can be autofilled with a gift card code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_GIFT_CARD_NUMBER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_GIFT_CARD_PIN

Hint indicating that this view can be autofilled with a gift card pin.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_GIFT_CARD_PIN).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_FLIGHT_NUMBER

Hint indicating that this view can be autofilled with a flight number. Examples: UA 355 (United Airlines), WN 355 (Southwest), AA 9158 (American Airlines)

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_FLIGHT_NUMBER).

See android.view.View for more info about autofill hints.

public static final java.lang.String AUTOFILL_HINT_FLIGHT_CONFIRMATION_CODE

Hint indicating that this view can be autofilled with a flight confirmation code.

Can be used with either android.view.View or android:autofillHint (in which case the value should be #AUTOFILL_HINT_FLIGHT_CONFIRMATION_CODE).

See android.view.View for more info about autofill hints.

Methods

public static java.lang.String generateSmsOtpHintForCharacterPosition(int characterPosition)

Generates the corresponding hint that indicates that this view can be autofilled with the characterPosition'th character/digit of a SMS One Time Password (OTP).

Can be used with either android.view.View or android:autofillHint (in which case the value should be smsOTPCode{characterPosition}).

See android.view.View for more info about autofill hints.

Parameters:

characterPosition: value between 1 and 8 representing the character position of the OTP code that the service should autofill in the associated view.

Source

/*
 * Copyright 2019 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 androidx.autofill;

import androidx.annotation.NonNull;
import androidx.core.util.Preconditions;

/**
 * Contains all the officially supported autofill hint constants.
 *
 * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
 * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
 * should be <code>{@value #AUTOFILL_HINT_EMAIL_ADDRESS}</code>) or {@link
 * android.view.View#setAutofillHints(String[])}.
 */
public final class HintConstants {
    private HintConstants() {}

    // Hints copied from android.view.View for convenience

    /**
     * Hint indicating that this view can be autofilled with an email address.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_EMAIL_ADDRESS}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.3
     */
    public static final String AUTOFILL_HINT_EMAIL_ADDRESS = "emailAddress";

    /**
     * Hint indicating that this view can be autofilled with a user's real name.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_NAME}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     *
     * @deprecated replaced by <code>{@value #AUTOFILL_HINT_PERSON_NAME}</code> to be more specific
     */
    @Deprecated public static final String AUTOFILL_HINT_NAME = "name";

    /**
     * Hint indicating that this view can be autofilled with a username.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_USERNAME}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_USERNAME = "username";

    /**
     * Hint indicating that this view can be autofilled with a password.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PASSWORD}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PASSWORD = "password";

    /**
     * Hint indicating that this view can be autofilled with a wifi password.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_WIFI_PASSWORD}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_WIFI_PASSWORD = "wifiPassword";

    /**
     * Hint indicating that this view can be autofilled with a phone number.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PHONE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     *
     * @deprecated replaced by <code>{@value #AUTOFILL_HINT_PHONE_NUMBER}</code> to be more specific
     */
    @Deprecated public static final String AUTOFILL_HINT_PHONE = "phone";

    /**
     * Hint indicating that this view can be autofilled with a postal address.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS = "postalAddress";

    /**
     * Hint indicating that this view can be autofilled with a postal code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_CODE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_CODE = "postalCode";

    /**
     * Hint indicating that this view can be autofilled with a credit card number.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_CREDIT_CARD_NUMBER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_CREDIT_CARD_NUMBER = "creditCardNumber";

    /**
     * Hint indicating that this view can be autofilled with a credit card security code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE = "creditCardSecurityCode";

    /**
     * Hint indicating that this view can be autofilled with a credit card expiration date.
     *
     * <p>It should be used when the credit card expiration date is represented by just one view; if
     * it is represented by more than one (for example, one view for the month and another view for
     * the year), then each of these views should use the hint specific for the unit ({@link
     * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY}, {@link
     * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH}, or {@link
     * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR}).
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE}</code>).
     *
     * <p>When annotating a view with this hint, it's recommended to use a date autofill value to
     * avoid ambiguity when the autofill service provides a value for it. To understand why a value
     * can be ambiguous, consider "April of 2020", which could be represented as either of the
     * following options:
     *
     * <ul>
     *   <li>{@code "04/2020"}
     *   <li>{@code "4/2020"}
     *   <li>{@code "2020/04"}
     *   <li>{@code "2020/4"}
     *   <li>{@code "April/2020"}
     *   <li>{@code "Apr/2020"}
     * </ul>
     *
     * <p>You define a date autofill value for the view by overriding the following methods:
     *
     * <ol>
     *   <li>{@link android.view.View#getAutofillType()} to return {@link
     *       android.view.View#AUTOFILL_TYPE_DATE}.
     *   <li>{@link android.view.View#getAutofillValue()} to return a {@link
     *       android.view.autofill.AutofillValue#forDate(long) date autofillvalue}.
     *   <li>{@link android.view.View#autofill(android.view.autofill.AutofillValue)} to expect a
     *       data autofillvalue.
     * </ol>
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE =
            "creditCardExpirationDate";

    /**
     * Hint indicating that this view can be autofilled with a credit card expiration month.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH}</code>).
     *
     * <p>When annotating a view with this hint, it's recommended to use a text autofill value whose
     * value is the numerical representation of the month, starting on {@code 1} to avoid ambiguity
     * when the autofill service provides a value for it. To understand why a value can be
     * ambiguous, consider "January", which could be represented as either of
     *
     * <ul>
     *   <li>{@code "1"}: recommended way.
     *   <li>{@code "0"}: if following the {@link java.util.Calendar#MONTH} convention.
     *   <li>{@code "January"}: full name, in English.
     *   <li>{@code "jan"}: abbreviated name, in English.
     *   <li>{@code "Janeiro"}: full name, in another language.
     * </ul>
     *
     * <p>Another recommended approach is to use a date autofill value - see {@link
     * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE} for more details.
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH =
            "creditCardExpirationMonth";

    /**
     * Hint indicating that this view can be autofilled with a credit card expiration year.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR =
            "creditCardExpirationYear";

    /**
     * Hint indicating that this view can be autofilled with a credit card expiration day.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY = "creditCardExpirationDay";

    // New Extended Hints

    /**
     * Hint indicating that this view can be autofilled with a country name/code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_COUNTRY}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_COUNTRY = "addressCountry";

    /**
     * Hint indicating that this view can be autofilled with a region/state.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_REGION}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_REGION = "addressRegion";

    /**
     * Hint indicating that this view can be autofilled with an address locality (city/town).
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_LOCALITY}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_LOCALITY = "addressLocality";

    /**
     * Hint indicating that this view can be autofilled with a street address.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_STREET_ADDRESS}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_STREET_ADDRESS = "streetAddress";

    /**
     * Hint indicating that this view can be autofilled with auxiliary address details.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_ADDRESS}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_ADDRESS = "extendedAddress";

    /**
     * Hint indicating that this view can be autofilled with an extended ZIP/POSTAL code.
     *
     * <p>Example: In forms that split the U.S. ZIP+4 Code with nine digits 99999-9999 into two
     * fields annotate the delivery route code with this hint.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_POSTAL_CODE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_EXTENDED_POSTAL_CODE =
            "extendedPostalCode";

    /**
     * Hint indicating that this view can be autofilled with an apartment/room/suite number.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_APT_NUMBER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_APT_NUMBER = "aptNumber";

    /**
     * Hint indicating that this view can be autofilled with a dependent locality i.e.
     * district/locality division/postal division/suburb etc.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_POSTAL_ADDRESS_DEPENDENT_LOCALITY}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_POSTAL_ADDRESS_DEPENDENT_LOCALITY =
            "dependentLocality";

    /**
     * Hint indicating that this view can be autofilled with a person's full name.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME = "personName";

    /**
     * Hint indicating that this view can be autofilled with a person's first/given name.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME_GIVEN}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME_GIVEN = "personGivenName";

    /**
     * Hint indicating that this view can be autofilled with a person's last/family name.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME_FAMILY}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME_FAMILY = "personFamilyName";

    /**
     * Hint indicating that this view can be autofilled with a person's middle name.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME_MIDDLE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME_MIDDLE = "personMiddleName";

    /**
     * Hint indicating that this view can be autofilled with a person's middle initial.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME_MIDDLE_INITIAL}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME_MIDDLE_INITIAL = "personMiddleInitial";

    /**
     * Hint indicating that this view can be autofilled with a person's name prefix.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME_PREFIX}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME_PREFIX = "personNamePrefix";

    /**
     * Hint indicating that this view can be autofilled with a person's name suffix.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PERSON_NAME_SUFFIX}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PERSON_NAME_SUFFIX = "personNameSuffix";

    /**
     * Hint indicating that this view can be autofilled with the user's full phone number with
     * country code.
     *
     * <p>Example: <code>+1 123-456-7890</code>
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PHONE_NUMBER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PHONE_NUMBER = "phoneNumber";

    /**
     * Hint indicating that this view can be autofilled with the current device's phone number
     * usually for Sign Up / OTP flows.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PHONE_NUMBER_DEVICE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PHONE_NUMBER_DEVICE = "phoneNumberDevice";

    /**
     * Hint indicating that this view can be autofilled with a phone number's country code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PHONE_COUNTRY_CODE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PHONE_COUNTRY_CODE = "phoneCountryCode";

    /**
     * Hint indicating that this view can be autofilled with a phone number without country code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PHONE_NATIONAL}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PHONE_NATIONAL = "phoneNational";

    /**
     * Hint indicating that this view can be interpreted as a newly created username for
     * save/update.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_NEW_USERNAME}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_NEW_USERNAME = "newUsername";

    /**
     * Hint indicating that this view can be interpreted as a newly created password for
     * save/update.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_NEW_PASSWORD}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_NEW_PASSWORD = "newPassword";

    /**
     * Hint indicating that this view can be autofilled with a gender.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_GENDER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_GENDER = "gender";

    /**
     * Hint indicating that this view can be autofilled with a full birth date.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_BIRTH_DATE_FULL}</code>).
     *
     * <p>The recommended approach is to use a date autofill value - see {@link
     * #AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE} for more details.
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_BIRTH_DATE_FULL = "birthDateFull";

    /**
     * Hint indicating that this view can be autofilled with a birth day(of the month).
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_BIRTH_DATE_DAY}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_BIRTH_DATE_DAY = "birthDateDay";

    /**
     * Hint indicating that this view can be autofilled with a birth month.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_BIRTH_DATE_MONTH}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_BIRTH_DATE_MONTH = "birthDateMonth";

    /**
     * Hint indicating that this view can be autofilled with a birth year.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_BIRTH_DATE_YEAR}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_BIRTH_DATE_YEAR = "birthDateYear";

    /**
     * Hint indicating that this view can be autofilled with a SMS One Time Password (OTP).
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_SMS_OTP}</code>).
     *
     * <p>When annotating OTP code fields which map to a single digit of the code consider using
     * <code>{@link #generateSmsOtpHintForCharacterPosition}</code>
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_SMS_OTP = "smsOTPCode";

    /**
     * Generates the corresponding hint that indicates that this view can be autofilled with the
     * {@code characterPosition}'th character/digit of a SMS One Time Password (OTP).
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>smsOTPCode{characterPosition}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     *
     * @param characterPosition value between 1 and 8 representing the character position of the OTP
     *     code that the service should autofill in the associated view.
     */
    @NonNull
    public static String generateSmsOtpHintForCharacterPosition(int characterPosition) {
        Preconditions.checkArgumentInRange(characterPosition, 1, 8, "characterPosition");
        return ("smsOTPCode" + characterPosition).intern();
    }

    /**
     * Hint indicating that this view can be autofilled with an Email One Time Password (OTP).
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_EMAIL_OTP}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_EMAIL_OTP = "emailOTPCode";

    /**
     * Hint indicating that this view can be autofilled with an Time-Based One Time Password (OTP)
     * generated by 2FA apps.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_2FA_APP_OTP}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_2FA_APP_OTP = "2faAppOTPCode";

    /**
     * Hint indicating that this view is not eligible for autofill.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_NOT_APPLICABLE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_NOT_APPLICABLE = "notApplicable";

    /**
     * Hint indicating that this view can be autofilled with a promo/coupon code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_PROMO_CODE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_PROMO_CODE = "promoCode";

    /**
     * Hint indicating that this view can be autofilled with an Unified Payments Interface (UPI)
     * Virtual Payment Address.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_UPI_VPA}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_UPI_VPA = "upiVirtualPaymentAddress";

    /**
     * Hint indicating that this view can be autofilled with a loyalty number.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_LOYALTY_ACCOUNT_NUMBER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_LOYALTY_ACCOUNT_NUMBER = "loyaltyAccountNumber";

    /**
     * Hint indicating that this view can be autofilled with a gift card code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_GIFT_CARD_NUMBER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_GIFT_CARD_NUMBER = "giftCardNumber";

    /**
     * Hint indicating that this view can be autofilled with a gift card pin.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_GIFT_CARD_PIN}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_GIFT_CARD_PIN = "giftCardPIN";

    /**
     * Hint indicating that this view can be autofilled with a flight number.
     * Examples: UA 355 (United Airlines), WN 355 (Southwest), AA 9158 (American Airlines)
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_FLIGHT_NUMBER}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_FLIGHT_NUMBER = "flightNumber";

    /**
     * Hint indicating that this view can be autofilled with a flight confirmation code.
     *
     * <p>Can be used with either {@link android.view.View#setAutofillHints(String[])} or <a
     * href="#attr_android:autofillHint">{@code android:autofillHint}</a> (in which case the value
     * should be <code>{@value #AUTOFILL_HINT_FLIGHT_CONFIRMATION_CODE}</code>).
     *
     * <p>See {@link android.view.View#setAutofillHints(String...)} for more info about autofill
     * hints.
     */
    public static final String AUTOFILL_HINT_FLIGHT_CONFIRMATION_CODE = "flightConfirmationCode";
}