Using the phone number without formate for the unique DisplayName
If the phone number has formate, the getUniqueSubscriptionDisplayNames may have the white space. Bug: 318022908 Change-Id: I459fb244ec690eff03d565b494b007849ef44c8b Test: atest SubscriptionUtilTest
This commit is contained in:
@@ -335,8 +335,16 @@ public class SubscriptionUtil {
|
||||
|
||||
if (duplicateOriginalNames.contains(info.originalName)) {
|
||||
// This may return null, if the user cannot view the phone number itself.
|
||||
final String phoneNumber = getBidiFormattedPhoneNumber(context,
|
||||
info.subscriptionInfo);
|
||||
String phoneNumber = "";
|
||||
try {
|
||||
final SubscriptionManager subscriptionManager = context.getSystemService(
|
||||
SubscriptionManager.class);
|
||||
phoneNumber = subscriptionManager.getPhoneNumber(infoSubId);
|
||||
} catch (IllegalStateException
|
||||
| SecurityException
|
||||
| UnsupportedOperationException e) {
|
||||
Log.w(TAG, "get number error." + e);
|
||||
}
|
||||
String lastFourDigits = "";
|
||||
if (phoneNumber != null) {
|
||||
lastFourDigits = (phoneNumber.length() > 4)
|
||||
|
||||
Reference in New Issue
Block a user