diff options
author | Cassie(Yitong) Wang <cassieyw@google.com> | 2020-03-05 18:18:16 -0800 |
---|---|---|
committer | Cassie(Yitong) Wang <cassieyw@google.com> | 2020-03-10 23:11:32 -0700 |
commit | e29919ff92a4b40a6ac81f1dcd6997fcf9364006 (patch) | |
tree | 5e0f7a873d185a753091a82972046d5b4da40eb5 | |
parent | 0c9afb2b2e84c47c29e622bfa13910c11efd943b (diff) | |
download | Dialer-e29919ff92a4b40a6ac81f1dcd6997fcf9364006.tar.gz |
Update isValidNumber check
Bug: 150752846
Test: Manually
Change-Id: Ia7ac8f743bce961cfb39dbfe66ec74d5673e84eb
-rw-r--r-- | src/com/android/car/dialer/telecom/UiCallManager.java | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/com/android/car/dialer/telecom/UiCallManager.java b/src/com/android/car/dialer/telecom/UiCallManager.java index 956121cd..6822c2d5 100644 --- a/src/com/android/car/dialer/telecom/UiCallManager.java +++ b/src/com/android/car/dialer/telecom/UiCallManager.java @@ -42,11 +42,6 @@ import com.android.car.telephony.common.TelecomUtils; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.ITelephony; -import com.google.i18n.phonenumbers.PhoneNumberUtil; -import com.google.i18n.phonenumbers.PhoneNumberUtil.PhoneNumberType; -import com.google.i18n.phonenumbers.PhoneNumberUtil.ValidationResult; -import com.google.i18n.phonenumbers.Phonenumber; - import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -307,24 +302,13 @@ public class UiCallManager { } /** - * Runs basic validation check of a phone number, to verify it is the correct length - * in an internationalized way. Further validation on whether the number actually exists - * is left for the phone carrier. + * Runs basic validation check of a phone number, to verify it is not empty. */ private boolean isValidNumber(String number) { - Phonenumber.PhoneNumber phoneNumber = TelecomUtils.createI18nPhoneNumber(mContext, - number); - if (phoneNumber != null) { - for (PhoneNumberType type : PhoneNumberType.values()) { - ValidationResult result = - PhoneNumberUtil.getInstance().isPossibleNumberForTypeWithReason(phoneNumber, - type); - if (result != ValidationResult.TOO_SHORT && result != ValidationResult.TOO_LONG) { - return true; - } - } + if (TextUtils.isEmpty(number)) { + return false; } - return false; + return true; } public void callVoicemail() { |