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

Commit 0e3be24a authored by Joachim Breuer's avatar Joachim Breuer
Browse files

Fix contact lookup with CLIR prefix

Allow phone numbers which are saved in the phonebook including a
CLIR prefix to be correctly resolved on an incoming call.

For a proper fix, all special cases detailed in calledPartyBCDToString()
should be taken into account; unfortunately that function cannot be
directly used as it currently is.

Change-Id: Ie070e1efc0921bfb0ae0802f500afced5071a652
parent df259ec5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1480,6 +1480,13 @@ public class PhoneNumberUtils
     * @hide
     */
    public static String normalizeNumber(String phoneNumber) {
        // chop off CLIR prefix
        if (phoneNumber.startsWith(CLIR_ON)) {
            phoneNumber = phoneNumber.substring(CLIR_ON.length() - 1);
        } else if (phoneNumber.startsWith(CLIR_OFF)) {
            phoneNumber = phoneNumber.substring(CLIR_OFF.length() - 1);
        }

        StringBuilder sb = new StringBuilder();
        int len = phoneNumber.length();
        for (int i = 0; i < len; i++) {