Uppercase region code so that AsYouTypeFormatter works correctly.

Change-Id: Iaf46ec5241a1a8984753bd6d8f9f842884efaa15
This commit is contained in:
Shaopeng Jia
2011-06-24 13:45:30 +02:00
parent e4ae434731
commit 5b0b167f7f

View File

@@ -94,6 +94,9 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
*/
public PhoneNumberFormattingTextWatcher(String countryCode) {
if (countryCode == null) throw new IllegalArgumentException();
// TODO: remove this once CountryDetector.detectCountry().getCountryIso() is fixed to always
// return uppercase. Tracked at b/4941319.
countryCode = countryCode.toUpperCase(Locale.ENGLISH);
mFormatter = PhoneNumberUtil.getInstance().getAsYouTypeFormatter(countryCode);
}