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

Commit 3cfe868c authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Gerrit Code Review
Browse files

Merge "Use getNationalSignificantNumber to get phone number in national format...

Merge "Use getNationalSignificantNumber to get phone number in national format with correct number of leading zeros." into main
parents cd7765fd 9f2029ff
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -121,7 +121,8 @@ public class FdnUtils {
        try {
            PhoneNumber phoneNumber = phoneNumberUtil.parse(dialStr, defaultCountryIso);
            dialStrE164 = phoneNumberUtil.format(phoneNumber, PhoneNumberFormat.E164);
            dialStrNational = String.valueOf(phoneNumber.getNationalNumber());
            dialStrNational = String.valueOf(
                    phoneNumberUtil.getNationalSignificantNumber(phoneNumber));
        } catch (NumberParseException ignored) {
            Rlog.w(LOG_TAG, "isFDN: could not parse dialStr");
            dialStr = extractSMSC(dialStr);
+9 −0
Original line number Diff line number Diff line
@@ -181,4 +181,13 @@ public class FdnUtilsTest {

        assertTrue(FdnUtils.isFDN("1234560000@ims.mnc.org", "US", fdnList));
    }

    @Test
    public void dialStrInNationalFormat_returnsTrue() {
        ArrayList<AdnRecord> fdnList = initializeFdnList();
        AdnRecord adnRecord = new AdnRecord(null, "0469887529");
        fdnList.add(8, adnRecord);

        assertTrue(FdnUtils.isFDN("0469887529", "US", fdnList));
    }
}
 No newline at end of file