Checking the max length of phone number in TM#setLine1NumberForDisplay
Flag: EXEMPT bugfix
Bug: 349320262
Test: Manually verified
Change-Id: I629e5d4b3c214ba68ce1635dea87b4ca9194a067
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 9aed910..30a6f03 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -480,6 +480,8 @@
private static final int MODEM_ACTIVITY_TIME_OFFSET_CORRECTION_MS = 50;
+ private static final int LINE1_NUMBER_MAX_LEN = 50;
+
/**
* With support for MEP(multiple enabled profile) in Android T, a SIM card can have more than
* one ICCID active at the same time.
@@ -7827,6 +7829,10 @@
if (phone == null) {
return false;
}
+ if (!TextUtils.isEmpty(number) && number.length() > LINE1_NUMBER_MAX_LEN) {
+ Rlog.e(LOG_TAG, "Number is too long");
+ return false;
+ }
final String subscriberId = phone.getSubscriberId();
if (DBG_MERGE) {