summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-03-11 23:15:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-11 23:15:18 +0000
commit6bc446f2eabd92f1677cfe09887c34eb42289717 (patch)
treeed38541b31fa030aa395f43ac1cd605f66baf042
parent259862248b466a7d60a76eba21182bb284ba1d50 (diff)
parente29919ff92a4b40a6ac81f1dcd6997fcf9364006 (diff)
downloadDialer-6bc446f2eabd92f1677cfe09887c34eb42289717.tar.gz
Merge "Update isValidNumber check" into qt-qpr1-dev
-rw-r--r--src/com/android/car/dialer/telecom/UiCallManager.java24
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() {