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

Commit f4178322 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Label dialog event package entries for conferences.

Dialog event package entries (multiendpoint) for a conference call on
another device will have a uri something like this:
sip:conf=2001-4888-205-710f-e0-113-0-120-1466524732857069@[2001

This ends up looking nasty in the UI.  To prevent this, adding code to
detect this type of URI and set the caller name to "Conference Call",
and blank out the caller number.

See bug for screenshot.

Bug: 29534470
Change-Id: I892897ca80347f57497928cb1b02fba83c3c664a
parent 4866c6d4
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.internal.telephony.imsphone;

import com.android.internal.R;
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallStateException;
import com.android.internal.telephony.Connection;
@@ -23,7 +24,9 @@ import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.UUSInfo;

import android.content.Context;
import android.net.Uri;
import android.telecom.PhoneAccount;
import android.telephony.PhoneNumberUtils;
import android.telephony.Rlog;
import android.util.Log;
@@ -45,6 +48,9 @@ import java.util.concurrent.ConcurrentHashMap;
 */
public class ImsExternalConnection extends Connection {

    private static final String CONFERENCE_PREFIX = "conf";
    private final Context mContext;

    public interface Listener {
        void onPullExternalCall(ImsExternalConnection connection);
    }
@@ -79,6 +85,7 @@ public class ImsExternalConnection extends Connection {

    protected ImsExternalConnection(Phone phone, int callId, Uri address, boolean isPullable) {
        super(phone.getPhoneType());
        mContext = phone.getContext();
        mCall = new ImsExternalCall(phone, this);
        mCallId = callId;
        setExternalConnectionAddress(address);
@@ -215,6 +222,15 @@ public class ImsExternalConnection extends Connection {
    public void setExternalConnectionAddress(Uri address) {
        mOriginalAddress = address;

        if (PhoneAccount.SCHEME_SIP.equals(address.getScheme())) {
            if (address.getSchemeSpecificPart().startsWith(CONFERENCE_PREFIX)) {
                mCnapName = mContext.getString(com.android.internal.R.string.conference_call);
                mCnapNamePresentation = PhoneConstants.PRESENTATION_ALLOWED;
                mAddress = "";
                mNumberPresentation = PhoneConstants.PRESENTATION_RESTRICTED;
                return;
            }
        }
        Uri telUri = PhoneNumberUtils.convertSipUriToTelUri(address);
        mAddress = telUri.getSchemeSpecificPart();
    }