summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitri Plotnikov <dplotnikov@google.com>2010-07-28 20:37:26 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-07-28 20:37:26 -0700
commitaae052324fb1d3add554158974c5a6ee609739b3 (patch)
tree582dd9f4be38d299d75a706a001a7d66f3a1331d
parentaa6d39218bf410c1af48b116055929496e5d2299 (diff)
parent1e80299bd4761df8328be15476ca88f2d1f9b1d8 (diff)
downloadframeworks_base-aae052324fb1d3add554158974c5a6ee609739b3.zip
frameworks_base-aae052324fb1d3add554158974c5a6ee609739b3.tar.gz
frameworks_base-aae052324fb1d3add554158974c5a6ee609739b3.tar.bz2
Merge "Throws IllegalArgumentException if the country code is null."
-rw-r--r--telephony/java/android/telephony/PhoneNumberFormattingTextWatcher.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberFormattingTextWatcher.java b/telephony/java/android/telephony/PhoneNumberFormattingTextWatcher.java
index 782635e..ffabb7b 100644
--- a/telephony/java/android/telephony/PhoneNumberFormattingTextWatcher.java
+++ b/telephony/java/android/telephony/PhoneNumberFormattingTextWatcher.java
@@ -81,7 +81,7 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
* may not take effect on this instance.
*/
public PhoneNumberFormattingTextWatcher() {
- this (Locale.getDefault() != null ? Locale.getDefault().getCountry() : "US");
+ this(Locale.getDefault().getCountry());
}
/**
@@ -93,6 +93,7 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
* @hide
*/
public PhoneNumberFormattingTextWatcher(String countryCode) {
+ if (countryCode == null) throw new IllegalArgumentException();
mFormatter = PhoneNumberUtil.getInstance().getAsYouTypeFormatter(countryCode);
}
@@ -131,7 +132,7 @@ public class PhoneNumberFormattingTextWatcher implements TextWatcher {
stopFormatting();
} else if (mState == STATE_OTHER) {
// User must insert or remove the non-dialable characters in the begin or middle of
- // number, stop formatting.
+ // number, stop formatting.
stopFormatting();
}
}