Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e80299b authored by Bai Tao's avatar Bai Tao
Browse files

Throws IllegalArgumentException if the country code is null.

Also removed unnecessary Locale check

Change-Id: I547713372900f1ea71e2215c0023a0981b6aca94
parent 127fe814
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
    }