Fixing the issue with AsYouTypeFormatter accidentally remove national
prefix for some numbers.
Bug: 5631579
Change-Id: Ibc51892d31d3a9745f4e9b1a5f035dffe0a885a6
diff --git a/java/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java b/java/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java
index 5dd0ea2..7c713c8 100644
--- a/java/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java
+++ b/java/src/com/android/i18n/phonenumbers/AsYouTypeFormatter.java
@@ -334,7 +334,7 @@
}
return ableToFormat
? prefixBeforeNationalNumber + tempNationalNumber
- : tempNationalNumber;
+ : accruedInput.toString();
} else {
return attemptToChooseFormattingPattern();
}
@@ -402,7 +402,7 @@
}
return ableToFormat
? prefixBeforeNationalNumber + tempNationalNumber
- : tempNationalNumber;
+ : accruedInput.toString();
} else {
return prefixBeforeNationalNumber.toString();
}