Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java |
| index 75f294b70c1a0410b4206c77aee796eca252a7c9..e5c905209cd858e7990f05cc8dc42429c1600aee 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/ui/EditorView.java |
| @@ -13,12 +13,10 @@ import android.content.Context; |
| import android.content.DialogInterface; |
| import android.graphics.Color; |
| import android.graphics.drawable.ColorDrawable; |
| -import android.os.AsyncTask; |
| import android.os.Handler; |
| import android.support.v4.view.animation.FastOutLinearInInterpolator; |
| import android.support.v4.view.animation.LinearOutSlowInInterpolator; |
| import android.support.v7.widget.Toolbar.OnMenuItemClickListener; |
| -import android.telephony.PhoneNumberFormattingTextWatcher; |
| import android.text.InputFilter; |
| import android.text.Spanned; |
| import android.text.TextWatcher; |
| @@ -40,6 +38,7 @@ import android.widget.TextView; |
| import org.chromium.base.ApiCompatibilityUtils; |
| import org.chromium.base.VisibleForTesting; |
| import org.chromium.chrome.R; |
| +import org.chromium.chrome.browser.autofill.PhoneNumberUtil; |
| import org.chromium.chrome.browser.customtabs.CustomTabActivity; |
| import org.chromium.chrome.browser.payments.ui.PaymentRequestUI.PaymentRequestObserverForTest; |
| import org.chromium.chrome.browser.preferences.autofill.CreditCardNumberFormattingTextWatcher; |
| @@ -151,20 +150,10 @@ public class EditorView extends AlwaysDismissedDialog implements OnClickListener |
| }; |
| mCardNumberFormatter = new CreditCardNumberFormattingTextWatcher(); |
| - new AsyncTask<Void, Void, PhoneNumberFormattingTextWatcher>() { |
| - @Override |
| - protected PhoneNumberFormattingTextWatcher doInBackground(Void... unused) { |
| - return new PhoneNumberFormattingTextWatcher(); |
| - } |
| - |
| - @Override |
| - protected void onPostExecute(PhoneNumberFormattingTextWatcher result) { |
| - mPhoneFormatter = result; |
| - if (mPhoneInput != null) { |
| - mPhoneInput.addTextChangedListener(mPhoneFormatter); |
| - } |
| - } |
| - }.execute(); |
| + mPhoneFormatter = new PhoneNumberUtil.FormatTextWatcher(); |
| + if (mPhoneInput != null) { |
|
please use gerrit instead
2017/03/14 18:17:15
mPhoneInput is guaranteed to be null in constructo
gogerald1
2017/03/14 19:32:33
Done.
|
| + mPhoneInput.addTextChangedListener(mPhoneFormatter); |
| + } |
| } |
| /** Launches the Autofill help page on top of the current Context. */ |