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

Commit a839fa59 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Create Conferences with a call direction set

Instead of always using UNDEFINED, create conferences with the
direction sent for IMS multiparty conference hosts.

This allows the call to be logged with the correct direction in
the call log.

Bug: 153595501
Fixes: 154246448
Test: atest TelecomUnitTests
Merged-In: I7621752f4f6fabeb1b17bac44c4e5e2795c7d052
Change-Id: I7621752f4f6fabeb1b17bac44c4e5e2795c7d052
parent 072e4198
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -3291,6 +3291,8 @@ public class CallsManager extends Call.ListenerBase
                        Conference.CONNECT_TIME_NOT_SPECIFIED ? 0 :
                        parcelableConference.getConnectElapsedTimeMillis();

        int callDirection = Call.getRemappedCallDirection(parcelableConference.getCallDirection());

        PhoneAccountHandle connectionMgr =
                    mPhoneAccountRegistrar.getSimCallManagerFromHandle(phoneAccount,
                            mCurrentUserHandle);
@@ -3305,7 +3307,7 @@ public class CallsManager extends Call.ListenerBase
                null /* gatewayInfo */,
                connectionMgr,
                phoneAccount,
                Call.CALL_DIRECTION_UNDEFINED /* callDirection */,
                callDirection,
                false /* forceAttachToExistingConnection */,
                true /* isConference */,
                connectTime,
+15 −18
Original line number Diff line number Diff line
@@ -472,25 +472,22 @@ public class ConnectionServiceWrapper extends ServiceBinder implements
                    && mContext.checkCallingOrSelfPermission(MODIFY_PHONE_STATE)
                            != PackageManager.PERMISSION_GRANTED) {
                Log.w(this, "addConferenceCall from caller without permission!");
                parcelableConference = new ParcelableConference(
                parcelableConference = new ParcelableConference.Builder(
                        parcelableConference.getPhoneAccount(),
                        parcelableConference.getState(),
                        parcelableConference.getConnectionCapabilities(),
                        parcelableConference.getConnectionProperties(),
                        parcelableConference.getConnectionIds(),
                        parcelableConference.getVideoProvider(),
                        parcelableConference.getVideoState(),
                        0 /* connectTimeMillis */,
                        0 /* connectElapsedRealTime */,
                        parcelableConference.getStatusHints(),
                        parcelableConference.getExtras(),
                        parcelableConference.getHandle(),
                        parcelableConference.getHandlePresentation(),
                        "" /* callerDisplayName */,
                        TelecomManager.PRESENTATION_UNKNOWN /* callerDisplayNamePresentation */,
                        parcelableConference.getDisconnectCause(),
                        parcelableConference.isRingbackRequested()
                        );
                        parcelableConference.getState())
                        .setConnectionCapabilities(parcelableConference.getConnectionCapabilities())
                        .setConnectionProperties(parcelableConference.getConnectionProperties())
                        .setConnectionIds(parcelableConference.getConnectionIds())
                        .setVideoAttributes(parcelableConference.getVideoProvider(),
                                parcelableConference.getVideoState())
                        .setStatusHints(parcelableConference.getStatusHints())
                        .setExtras(parcelableConference.getExtras())
                        .setAddress(parcelableConference.getHandle(),
                                parcelableConference.getHandlePresentation())
                        // no caller display name set.
                        .setDisconnectCause(parcelableConference.getDisconnectCause())
                        .setRingbackRequested(parcelableConference.isRingbackRequested())
                        .build();
            }

            long token = Binder.clearCallingIdentity();
+9 −18
Original line number Diff line number Diff line
@@ -29,10 +29,8 @@ import android.content.ComponentName;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.telecom.CallAudioState;
@@ -714,22 +712,15 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService>
    }

    private ParcelableConference parcelable(ConferenceInfo c) {
        return new ParcelableConference(
                c.phoneAccount,
                c.state,
                c.capabilities,
                c.properties,
                c.connectionIds,
                c.videoProvider,
                c.videoState,
                c.connectTimeMillis,
                c.connectElapsedTimeMillis,
                c.statusHints,
                c.extras,
                null,
                0,
                null,
                0);
        return new ParcelableConference.Builder(c.phoneAccount, c.state)
                .setConnectionCapabilities(c.capabilities)
                .setConnectionProperties(c.properties)
                .setConnectionIds(c.connectionIds)
                .setVideoAttributes(c.videoProvider, c.videoState)
                .setConnectTimeMillis(c.connectTimeMillis, c.connectElapsedTimeMillis)
                .setStatusHints(c.statusHints)
                .setExtras(c.extras)
                .build();
    }

    private ParcelableConnection parcelable(ConnectionInfo c) {