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

Commit 36835138 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS-VT: Use original dialed string instead of normalized dial string"

parents ee43a088 668336ba
Loading
Loading
Loading
Loading
+3 −20
Original line number Diff line number Diff line
@@ -141,22 +141,6 @@ public class SearchFragment extends PhoneNumberPickerFragment {
        mAddToContactNumber = addToContactNumber;
    }

    /**
     * Adds a plus sign to the query string if original typed number was an international number.
     */
    private String addPlusSignPrefixToNumber(String actualNumber) {
        final StringBuilder number = new StringBuilder();

        // Check if actual number had + sign as the first character and query string does not, then
        // return a number with a + sign prefixed to the query string. That will be the dial string.
        if ((actualNumber != null) && actualNumber.startsWith("+") && (getQueryString() != null)
                && !(getQueryString().startsWith("+"))) {
            number.append('+');
        }
        number.append(getQueryString());
        return number.toString();
    }

    /**
     * Return true if phone number is prohibited by a value -
     * (R.string.config_prohibited_phone_number_regexp) in the config files. False otherwise.
@@ -197,8 +181,7 @@ public class SearchFragment extends PhoneNumberPickerFragment {
        final int shortcutType = adapter.getShortcutTypeFromPosition(position);
        final OnPhoneNumberPickerActionListener listener;

        String dialingNumber = addPlusSignPrefixToNumber(mAddToContactNumber);
        boolean ret = checkForProhibitedPhoneNumber(dialingNumber);
        boolean ret = checkForProhibitedPhoneNumber(mAddToContactNumber);

        switch (shortcutType) {
            case DialerPhoneNumberListAdapter.SHORTCUT_INVALID:
@@ -207,7 +190,7 @@ public class SearchFragment extends PhoneNumberPickerFragment {
            case DialerPhoneNumberListAdapter.SHORTCUT_DIRECT_CALL:
                listener = getOnPhoneNumberPickerListener();
                if (listener != null && !ret) {
                    listener.onCallNumberDirectly(dialingNumber);
                    listener.onCallNumberDirectly(getQueryString());
                }
                break;
            case DialerPhoneNumberListAdapter.SHORTCUT_ADD_NUMBER_TO_CONTACTS:
@@ -220,7 +203,7 @@ public class SearchFragment extends PhoneNumberPickerFragment {
            case DialerPhoneNumberListAdapter.SHORTCUT_MAKE_VIDEO_CALL:
                listener = getOnPhoneNumberPickerListener();
                if (listener != null && !ret) {
                    listener.onCallNumberDirectly(dialingNumber, true /* isVideoCall */);
                    listener.onCallNumberDirectly(mAddToContactNumber, true /* isVideoCall */);
                }
                break;
        }