Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1229c544 authored by SongFerng Wang's avatar SongFerng Wang
Browse files

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
parent 6c7dbdd6
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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)