| 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 4e871f2a52d3cd024d5b1328eb9e2a47158e0295..72b617829117135860efed83b064436208c06335 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
|
| @@ -225,6 +225,7 @@ public class EditorView extends AlwaysDismissedDialog
|
| new Runnable() {
|
| @Override
|
| public void run() {
|
| + removeTextChangedListenerFromPhoneInputField();
|
| // Do not remove the "* indicates required field" label at the
|
| // bottom.
|
| dataView.removeViews(0, dataView.getChildCount() - 1);
|
| @@ -283,11 +284,16 @@ public class EditorView extends AlwaysDismissedDialog
|
|
|
| @Override
|
| public void onDismiss(DialogInterface dialog) {
|
| - if (mPhoneInput != null) mPhoneInput.removeTextChangedListener(getPhoneFormatter());
|
| + removeTextChangedListenerFromPhoneInputField();
|
| mEditorModel.cancel();
|
| if (mObserverForTest != null) mObserverForTest.onPaymentRequestEditorDismissed();
|
| }
|
|
|
| + private void removeTextChangedListenerFromPhoneInputField() {
|
| + if (mPhoneInput != null) mPhoneInput.removeTextChangedListener(getPhoneFormatter());
|
| + mPhoneInput = null;
|
| + }
|
| +
|
| /** Immediately returns the phone formatter or null if it has not initialized yet. */
|
| private PhoneNumberFormattingTextWatcher getPhoneFormatter() {
|
| try {
|
|
|