Commit 3f0257f6 authored by Elizabeth Popova's avatar Elizabeth Popova Committed by Commit Bot

[Android] Remove unused value from AddressEditor.Purpose enum

AddressEditor.Purpose.AUTOFILL_ASSISTANT is defined but no longer used. Now autofill assistant uses AddressEditor.Purpose.PAYMENT_REQUEST, see [1].

[1]https://source.chromium.org/chromium/chromium/src/+/master:chrome/android/features/autofill_assistant/java/src/org/chromium/chrome/browser/autofill_assistant/user_data/AssistantCollectUserDataBinder.java;l=672

Change-Id: Idb67ca782c7c9f28d24e3bda722ac31d2f77a736
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2489994Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarChristoph Schwering <schwering@google.com>
Commit-Queue: Elizabeth Popova <lizapopova@google.com>
Cr-Commit-Position: refs/heads/master@{#819829}
parent ea5439ac
...@@ -42,12 +42,11 @@ import java.util.UUID; ...@@ -42,12 +42,11 @@ import java.util.UUID;
*/ */
public class AddressEditor public class AddressEditor
extends EditorBase<AutofillAddress> implements GetSubKeysRequestDelegate { extends EditorBase<AutofillAddress> implements GetSubKeysRequestDelegate {
@IntDef({Purpose.PAYMENT_REQUEST, Purpose.AUTOFILL_SETTINGS, Purpose.AUTOFILL_ASSISTANT}) @IntDef({Purpose.PAYMENT_REQUEST, Purpose.AUTOFILL_SETTINGS})
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface Purpose { public @interface Purpose {
int PAYMENT_REQUEST = 1; int PAYMENT_REQUEST = 1;
int AUTOFILL_SETTINGS = 2; int AUTOFILL_SETTINGS = 2;
int AUTOFILL_ASSISTANT = 3;
} }
private final Handler mHandler = new Handler(); private final Handler mHandler = new Handler();
...@@ -80,8 +79,8 @@ public class AddressEditor ...@@ -80,8 +79,8 @@ public class AddressEditor
/** /**
* Builds an address editor. * Builds an address editor.
* *
* @param purpose The purpose of this address editor. One of Purpose.PAYMENT_REQUEST, * @param purpose The purpose of this address editor. One of
* Purpose.AUTOFILL_SETTINGS, or Purpose.AUTOFILL_ASSISTANT. * Purpose.PAYMENT_REQUEST or Purpose.AUTOFILL_SETTINGS.
* @param saveToDisk Whether to save changes to disk after editing. * @param saveToDisk Whether to save changes to disk after editing.
*/ */
public AddressEditor(@Purpose int purpose, boolean saveToDisk) { public AddressEditor(@Purpose int purpose, boolean saveToDisk) {
...@@ -150,13 +149,14 @@ public class AddressEditor ...@@ -150,13 +149,14 @@ public class AddressEditor
/** /**
* Builds and shows an editor model with the following fields. * Builds and shows an editor model with the following fields.
* *
* [ country dropdown ] <----- country dropdown is always present. * [ country dropdown ] <----- country dropdown is always present.
* [ an address field ] \ * [ an address field ] \
* [ an address field ] \ * [ an address field ] \
* ... <-- field order, presence, required, and labels depend on country. * ... <-- field order, presence, required, and labels depend on country.
* [ an address field ] / * [ an address field ] /
* [ an address field ] / * [ an address field ] /
* [ phone number field ] <----- phone is always present and required. * [ phone number field ] <----- phone is always present and required.
* [ email address field ] <----- only present if purpose is Purpose.AUTOFILL_SETTINGS.
*/ */
@Override @Override
public void edit(@Nullable final AutofillAddress toEdit, public void edit(@Nullable final AutofillAddress toEdit,
...@@ -263,8 +263,8 @@ public class AddressEditor ...@@ -263,8 +263,8 @@ public class AddressEditor
// that's being edited. // that's being edited.
mPhoneField.setValue(mProfile.getPhoneNumber()); mPhoneField.setValue(mProfile.getPhoneNumber());
// Email address is present for autofill settings and autofill assistant. // Email address is present only for autofill settings.
if (mPurpose != Purpose.PAYMENT_REQUEST) { if (mPurpose == Purpose.AUTOFILL_SETTINGS) {
if (mEmailField == null) { if (mEmailField == null) {
mEmailField = EditorFieldModel.createTextInput( mEmailField = EditorFieldModel.createTextInput(
EditorFieldModel.INPUT_TYPE_HINT_EMAIL, EditorFieldModel.INPUT_TYPE_HINT_EMAIL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment