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

Commit 82174563 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android Git Automerger
Browse files

am a9277f19: am 5b069901: Merge "Fix for call timer resetting when starting...

am a9277f19: am 5b069901: Merge "Fix for call timer resetting when starting IMS conference call. 4/4" into lmp-mr1-dev

* commit 'a9277f19':
  Fix for call timer resetting when starting IMS conference call. 4/4
parents 54eb0b21 a9277f19
Loading
Loading
Loading
Loading
+31 −7
Original line number Diff line number Diff line
@@ -334,13 +334,6 @@ final class Call implements CreateConnectionResponse {
            boolean isIncoming,
            boolean isConference) {
        mState = isConference ? CallState.ACTIVE : CallState.NEW;

        // Conference calls are considered connected upon adding to Telecom, so set the connect
        // time now.
        if (isConference) {
            mConnectTimeMillis = System.currentTimeMillis();
        }

        mContext = context;
        mRepository = repository;
        setHandle(handle);
@@ -353,6 +346,37 @@ final class Call implements CreateConnectionResponse {
        maybeLoadCannedSmsResponses();
    }

    /**
     * Persists the specified parameters and initializes the new instance.
     *
     * @param context The context.
     * @param repository The connection service repository.
     * @param handle The handle to dial.
     * @param gatewayInfo Gateway information to use for the call.
     * @param connectionManagerPhoneAccountHandle Account to use for the service managing the call.
     *         This account must be one that was registered with the
     *         {@link PhoneAccount#CAPABILITY_CONNECTION_MANAGER} flag.
     * @param targetPhoneAccountHandle Account information to use for the call. This account must be
     *         one that was registered with the {@link PhoneAccount#CAPABILITY_CALL_PROVIDER} flag.
     * @param isIncoming True if this is an incoming call.
     * @param connectTimeMillis The connection time of the call.
     */
    Call(
            Context context,
            ConnectionServiceRepository repository,
            Uri handle,
            GatewayInfo gatewayInfo,
            PhoneAccountHandle connectionManagerPhoneAccountHandle,
            PhoneAccountHandle targetPhoneAccountHandle,
            boolean isIncoming,
            boolean isConference,
            long connectTimeMillis) {
        this(context, repository, handle, gatewayInfo, connectionManagerPhoneAccountHandle,
                targetPhoneAccountHandle, isIncoming, isConference);

        mConnectTimeMillis = connectTimeMillis;
    }

    void addListener(Listener listener) {
        mListeners.add(listener);
    }
+11 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Trace;
import android.provider.CallLog.Calls;
import android.telecom.AudioState;
import android.telecom.CallState;
import android.telecom.Conference;
import android.telecom.Connection;
import android.telecom.DisconnectCause;
import android.telecom.GatewayInfo;
@@ -1039,6 +1040,14 @@ public final class CallsManager extends Call.ListenerBase {
    Call createConferenceCall(
            PhoneAccountHandle phoneAccount,
            ParcelableConference parcelableConference) {

        // If the parceled conference specifies a connect time, use it; otherwise default to 0,
        // which is the default value for new Calls.
        long connectTime =
                parcelableConference.getConnectTimeMillis() ==
                        Conference.CONNECT_TIME_NOT_SPECIFIED ? 0 :
                        parcelableConference.getConnectTimeMillis();

        Call call = new Call(
                mContext,
                mConnectionServiceRepository,
@@ -1047,7 +1056,8 @@ public final class CallsManager extends Call.ListenerBase {
                null /* connectionManagerPhoneAccount */,
                phoneAccount,
                false /* isIncoming */,
                true /* isConference */);
                true /* isConference */,
                connectTime);

        setCallState(call, Call.getStateFromConnectionState(parcelableConference.getState()));
        call.setConnectionCapabilities(parcelableConference.getConnectionCapabilities());