Loading api/current.txt +5 −4 Original line number Diff line number Diff line Loading @@ -36392,16 +36392,17 @@ package android.service.autofill { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR; field public static final int SAVE_UI_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_UI_TYPE_CREDENTIALS = 1; // 0x1 field public static final int SAVE_UI_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_UI_TYPE_PAYMENT = 3; // 0x3 field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3 field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1 } public static final class SaveInfo.Builder { ctor public SaveInfo.Builder(int); method public android.service.autofill.SaveInfo.Builder addSavableIds(android.view.autofill.AutoFillId...); method public android.service.autofill.SaveInfo build(); method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence); } } api/system-current.txt +5 −4 Original line number Diff line number Diff line Loading @@ -39312,16 +39312,17 @@ package android.service.autofill { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR; field public static final int SAVE_UI_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_UI_TYPE_CREDENTIALS = 1; // 0x1 field public static final int SAVE_UI_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_UI_TYPE_PAYMENT = 3; // 0x3 field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3 field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1 } public static final class SaveInfo.Builder { ctor public SaveInfo.Builder(int); method public android.service.autofill.SaveInfo.Builder addSavableIds(android.view.autofill.AutoFillId...); method public android.service.autofill.SaveInfo build(); method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence); } } api/test-current.txt +5 −4 Original line number Diff line number Diff line Loading @@ -36531,16 +36531,17 @@ package android.service.autofill { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR; field public static final int SAVE_UI_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_UI_TYPE_CREDENTIALS = 1; // 0x1 field public static final int SAVE_UI_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_UI_TYPE_PAYMENT = 3; // 0x3 field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3 field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1 } public static final class SaveInfo.Builder { ctor public SaveInfo.Builder(int); method public android.service.autofill.SaveInfo.Builder addSavableIds(android.view.autofill.AutoFillId...); method public android.service.autofill.SaveInfo build(); method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence); } } core/java/android/service/autofill/FillResponse.java +2 −2 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public final class FillResponse implements Parcelable { // Handle the the case where service didn't call setSavableIds() because it would // contain just the ids from the datasets. if (saveInfo == null && mDatasets != null) { saveInfo = new SaveInfo.Builder(SaveInfo.SAVE_UI_TYPE_GENERIC).build(); saveInfo = new SaveInfo.Builder(SaveInfo.SAVE_DATA_TYPE_GENERIC).build(); } if (saveInfo != null) { saveInfo.addSavableIds(mDatasets); Loading Loading @@ -324,7 +324,7 @@ public final class FillResponse implements Parcelable { throw new IllegalStateException("setSaveInfo() already called"); } if (mSaveInfoBuilder == null) { mSaveInfoBuilder = new SaveInfo.Builder(SaveInfo.SAVE_UI_TYPE_GENERIC); mSaveInfoBuilder = new SaveInfo.Builder(SaveInfo.SAVE_DATA_TYPE_GENERIC); } mSaveInfoBuilder.addSavableIds(ids); Loading core/java/android/service/autofill/SaveInfo.java +51 −24 Original line number Diff line number Diff line Loading @@ -52,43 +52,44 @@ public final class SaveInfo implements Parcelable { * Type used on when the service can save the contents of an activity, but cannot describe what * the content is for. */ public static final int SAVE_UI_TYPE_GENERIC = 0; public static final int SAVE_DATA_TYPE_GENERIC = 0; /** * Type used when the {@link FillResponse} represents user credentials (such as username and * password). * Type used when the {@link FillResponse} represents user credentials that have a password. */ public static final int SAVE_UI_TYPE_CREDENTIALS = 1; public static final int SAVE_DATA_TYPE_PASSWORD = 1; /** * Type used on when the {@link FillResponse} represents a physical address (such as street, * city, state, etc). */ public static final int SAVE_UI_TYPE_ADDRESS = 2; public static final int SAVE_DATA_TYPE_ADDRESS = 2; /** * Type used when the {@link FillResponse} represents a payment (such as credit card number * and expiration date). * Type used when the {@link FillResponse} represents a credit card. */ public static final int SAVE_UI_TYPE_PAYMENT = 3; public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; private final @SaveUiType int mType; private final @SaveDataType int mType; private ArraySet<AutoFillId> mSavableIds; private final CharSequence mDescription; /** @hide */ @IntDef({ SAVE_UI_TYPE_GENERIC, SAVE_UI_TYPE_CREDENTIALS, SAVE_UI_TYPE_ADDRESS, SAVE_UI_TYPE_PAYMENT SAVE_DATA_TYPE_GENERIC, SAVE_DATA_TYPE_PASSWORD, SAVE_DATA_TYPE_ADDRESS, SAVE_DATA_TYPE_CREDIT_CARD }) @Retention(RetentionPolicy.SOURCE) public @interface SaveUiType { public @interface SaveDataType { } private SaveInfo(Builder builder) { mType = builder.mType; mSavableIds = builder.mSavableIds; mDescription = builder.mDescription; } /** @hide */ Loading @@ -96,6 +97,16 @@ public final class SaveInfo implements Parcelable { return mSavableIds; } /** @hide */ public int getType() { return mType; } /** @hide */ public CharSequence getDescription() { return mDescription; } /** @hide */ public void addSavableIds(@Nullable ArrayList<Dataset> datasets) { if (datasets != null) { Loading @@ -120,27 +131,28 @@ public final class SaveInfo implements Parcelable { */ public static final class Builder { private final @SaveUiType int mType; private final @SaveDataType int mType; private ArraySet<AutoFillId> mSavableIds; private CharSequence mDescription; private boolean mDestroyed; /** * Creates a new builder. * * @param type the type of information the associated {@link FillResponse} represents. Must * be {@link SaveInfo#SAVE_UI_TYPE_GENERIC}, {@link SaveInfo#SAVE_UI_TYPE_CREDENTIALS}, * {@link SaveInfo#SAVE_UI_TYPE_ADDRESS}, or {@link SaveInfo#SAVE_UI_TYPE_PAYMENT}; * otherwise it will assume {@link SaveInfo#SAVE_UI_TYPE_GENERIC}. * be {@link SaveInfo#SAVE_DATA_TYPE_GENERIC}, {@link SaveInfo#SAVE_DATA_TYPE_PASSWORD}, * {@link SaveInfo#SAVE_DATA_TYPE_ADDRESS}, or {@link SaveInfo#SAVE_DATA_TYPE_CREDIT_CARD}; * otherwise it will assume {@link SaveInfo#SAVE_DATA_TYPE_GENERIC}. */ public Builder(@SaveUiType int type) { public Builder(@SaveDataType int type) { switch (type) { case SAVE_UI_TYPE_CREDENTIALS: case SAVE_UI_TYPE_ADDRESS: case SAVE_UI_TYPE_PAYMENT: case SAVE_DATA_TYPE_PASSWORD: case SAVE_DATA_TYPE_ADDRESS: case SAVE_DATA_TYPE_CREDIT_CARD: mType = type; break; default: mType = SAVE_UI_TYPE_GENERIC; mType = SAVE_DATA_TYPE_GENERIC; } } Loading Loading @@ -168,6 +180,20 @@ public final class SaveInfo implements Parcelable { return this; } /** * Sets an optional description to be shown in the UI when the user is asked to save. * * <p>Typically, it describes how the data will be stored by the service, so it can help * users to decide whether they can trust the service to save their data. * * @param description a succint description. * @return This Builder. */ public @NonNull Builder setDescription(@Nullable CharSequence description) { mDescription = description; return this; } /** * Builds a new {@link SaveInfo} instance. */ Loading Loading @@ -210,6 +236,7 @@ public final class SaveInfo implements Parcelable { public void writeToParcel(Parcel parcel, int flags) { parcel.writeInt(mType); parcel.writeTypedArraySet(mSavableIds, flags); parcel.writeCharSequence(mDescription); } public static final Parcelable.Creator<SaveInfo> CREATOR = new Parcelable.Creator<SaveInfo>() { Loading @@ -224,7 +251,7 @@ public final class SaveInfo implements Parcelable { for (int i = 0; i < savableIdsCount; i++) { builder.addSavableIds(savableIds.valueAt(i)); } builder.setDescription(parcel.readCharSequence()); return builder.build(); } Loading Loading
api/current.txt +5 −4 Original line number Diff line number Diff line Loading @@ -36392,16 +36392,17 @@ package android.service.autofill { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR; field public static final int SAVE_UI_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_UI_TYPE_CREDENTIALS = 1; // 0x1 field public static final int SAVE_UI_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_UI_TYPE_PAYMENT = 3; // 0x3 field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3 field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1 } public static final class SaveInfo.Builder { ctor public SaveInfo.Builder(int); method public android.service.autofill.SaveInfo.Builder addSavableIds(android.view.autofill.AutoFillId...); method public android.service.autofill.SaveInfo build(); method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence); } }
api/system-current.txt +5 −4 Original line number Diff line number Diff line Loading @@ -39312,16 +39312,17 @@ package android.service.autofill { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR; field public static final int SAVE_UI_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_UI_TYPE_CREDENTIALS = 1; // 0x1 field public static final int SAVE_UI_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_UI_TYPE_PAYMENT = 3; // 0x3 field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3 field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1 } public static final class SaveInfo.Builder { ctor public SaveInfo.Builder(int); method public android.service.autofill.SaveInfo.Builder addSavableIds(android.view.autofill.AutoFillId...); method public android.service.autofill.SaveInfo build(); method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence); } }
api/test-current.txt +5 −4 Original line number Diff line number Diff line Loading @@ -36531,16 +36531,17 @@ package android.service.autofill { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.autofill.SaveInfo> CREATOR; field public static final int SAVE_UI_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_UI_TYPE_CREDENTIALS = 1; // 0x1 field public static final int SAVE_UI_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_UI_TYPE_PAYMENT = 3; // 0x3 field public static final int SAVE_DATA_TYPE_ADDRESS = 2; // 0x2 field public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; // 0x3 field public static final int SAVE_DATA_TYPE_GENERIC = 0; // 0x0 field public static final int SAVE_DATA_TYPE_PASSWORD = 1; // 0x1 } public static final class SaveInfo.Builder { ctor public SaveInfo.Builder(int); method public android.service.autofill.SaveInfo.Builder addSavableIds(android.view.autofill.AutoFillId...); method public android.service.autofill.SaveInfo build(); method public android.service.autofill.SaveInfo.Builder setDescription(java.lang.CharSequence); } }
core/java/android/service/autofill/FillResponse.java +2 −2 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ public final class FillResponse implements Parcelable { // Handle the the case where service didn't call setSavableIds() because it would // contain just the ids from the datasets. if (saveInfo == null && mDatasets != null) { saveInfo = new SaveInfo.Builder(SaveInfo.SAVE_UI_TYPE_GENERIC).build(); saveInfo = new SaveInfo.Builder(SaveInfo.SAVE_DATA_TYPE_GENERIC).build(); } if (saveInfo != null) { saveInfo.addSavableIds(mDatasets); Loading Loading @@ -324,7 +324,7 @@ public final class FillResponse implements Parcelable { throw new IllegalStateException("setSaveInfo() already called"); } if (mSaveInfoBuilder == null) { mSaveInfoBuilder = new SaveInfo.Builder(SaveInfo.SAVE_UI_TYPE_GENERIC); mSaveInfoBuilder = new SaveInfo.Builder(SaveInfo.SAVE_DATA_TYPE_GENERIC); } mSaveInfoBuilder.addSavableIds(ids); Loading
core/java/android/service/autofill/SaveInfo.java +51 −24 Original line number Diff line number Diff line Loading @@ -52,43 +52,44 @@ public final class SaveInfo implements Parcelable { * Type used on when the service can save the contents of an activity, but cannot describe what * the content is for. */ public static final int SAVE_UI_TYPE_GENERIC = 0; public static final int SAVE_DATA_TYPE_GENERIC = 0; /** * Type used when the {@link FillResponse} represents user credentials (such as username and * password). * Type used when the {@link FillResponse} represents user credentials that have a password. */ public static final int SAVE_UI_TYPE_CREDENTIALS = 1; public static final int SAVE_DATA_TYPE_PASSWORD = 1; /** * Type used on when the {@link FillResponse} represents a physical address (such as street, * city, state, etc). */ public static final int SAVE_UI_TYPE_ADDRESS = 2; public static final int SAVE_DATA_TYPE_ADDRESS = 2; /** * Type used when the {@link FillResponse} represents a payment (such as credit card number * and expiration date). * Type used when the {@link FillResponse} represents a credit card. */ public static final int SAVE_UI_TYPE_PAYMENT = 3; public static final int SAVE_DATA_TYPE_CREDIT_CARD = 3; private final @SaveUiType int mType; private final @SaveDataType int mType; private ArraySet<AutoFillId> mSavableIds; private final CharSequence mDescription; /** @hide */ @IntDef({ SAVE_UI_TYPE_GENERIC, SAVE_UI_TYPE_CREDENTIALS, SAVE_UI_TYPE_ADDRESS, SAVE_UI_TYPE_PAYMENT SAVE_DATA_TYPE_GENERIC, SAVE_DATA_TYPE_PASSWORD, SAVE_DATA_TYPE_ADDRESS, SAVE_DATA_TYPE_CREDIT_CARD }) @Retention(RetentionPolicy.SOURCE) public @interface SaveUiType { public @interface SaveDataType { } private SaveInfo(Builder builder) { mType = builder.mType; mSavableIds = builder.mSavableIds; mDescription = builder.mDescription; } /** @hide */ Loading @@ -96,6 +97,16 @@ public final class SaveInfo implements Parcelable { return mSavableIds; } /** @hide */ public int getType() { return mType; } /** @hide */ public CharSequence getDescription() { return mDescription; } /** @hide */ public void addSavableIds(@Nullable ArrayList<Dataset> datasets) { if (datasets != null) { Loading @@ -120,27 +131,28 @@ public final class SaveInfo implements Parcelable { */ public static final class Builder { private final @SaveUiType int mType; private final @SaveDataType int mType; private ArraySet<AutoFillId> mSavableIds; private CharSequence mDescription; private boolean mDestroyed; /** * Creates a new builder. * * @param type the type of information the associated {@link FillResponse} represents. Must * be {@link SaveInfo#SAVE_UI_TYPE_GENERIC}, {@link SaveInfo#SAVE_UI_TYPE_CREDENTIALS}, * {@link SaveInfo#SAVE_UI_TYPE_ADDRESS}, or {@link SaveInfo#SAVE_UI_TYPE_PAYMENT}; * otherwise it will assume {@link SaveInfo#SAVE_UI_TYPE_GENERIC}. * be {@link SaveInfo#SAVE_DATA_TYPE_GENERIC}, {@link SaveInfo#SAVE_DATA_TYPE_PASSWORD}, * {@link SaveInfo#SAVE_DATA_TYPE_ADDRESS}, or {@link SaveInfo#SAVE_DATA_TYPE_CREDIT_CARD}; * otherwise it will assume {@link SaveInfo#SAVE_DATA_TYPE_GENERIC}. */ public Builder(@SaveUiType int type) { public Builder(@SaveDataType int type) { switch (type) { case SAVE_UI_TYPE_CREDENTIALS: case SAVE_UI_TYPE_ADDRESS: case SAVE_UI_TYPE_PAYMENT: case SAVE_DATA_TYPE_PASSWORD: case SAVE_DATA_TYPE_ADDRESS: case SAVE_DATA_TYPE_CREDIT_CARD: mType = type; break; default: mType = SAVE_UI_TYPE_GENERIC; mType = SAVE_DATA_TYPE_GENERIC; } } Loading Loading @@ -168,6 +180,20 @@ public final class SaveInfo implements Parcelable { return this; } /** * Sets an optional description to be shown in the UI when the user is asked to save. * * <p>Typically, it describes how the data will be stored by the service, so it can help * users to decide whether they can trust the service to save their data. * * @param description a succint description. * @return This Builder. */ public @NonNull Builder setDescription(@Nullable CharSequence description) { mDescription = description; return this; } /** * Builds a new {@link SaveInfo} instance. */ Loading Loading @@ -210,6 +236,7 @@ public final class SaveInfo implements Parcelable { public void writeToParcel(Parcel parcel, int flags) { parcel.writeInt(mType); parcel.writeTypedArraySet(mSavableIds, flags); parcel.writeCharSequence(mDescription); } public static final Parcelable.Creator<SaveInfo> CREATOR = new Parcelable.Creator<SaveInfo>() { Loading @@ -224,7 +251,7 @@ public final class SaveInfo implements Parcelable { for (int i = 0; i < savableIdsCount; i++) { builder.addSavableIds(savableIds.valueAt(i)); } builder.setDescription(parcel.readCharSequence()); return builder.build(); } Loading