Merge "Using the phone number without formate for the unique DisplayName" into main

This commit is contained in:
SongFerng Wang
2024-01-22 03:57:15 +00:00
committed by Android (Google) Code Review

View File

@@ -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)