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

Commit 2d6ceda2 authored by Bryce Lee's avatar Bryce Lee Committed by Android (Google) Code Review
Browse files

Merge "Properly route rejection reply when capability is set." into cw-e-dev

parents c23d020a ddd966e7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1091,7 +1091,7 @@ public class Call implements CreateConnectionResponse {
            // Ensure video state history tracks video state at time of rejection.
            mVideoStateHistory |= mVideoState;

            mConnectionService.reject(this);
            mConnectionService.reject(this, rejectWithMessage, textMessage);
            Log.event(this, Log.Events.REQUEST_REJECT);
        }
    }
+8 −2
Original line number Diff line number Diff line
@@ -774,12 +774,18 @@ final class ConnectionServiceWrapper extends ServiceBinder {
    }

    /** @see IConnectionService#reject(String) */
    void reject(Call call) {
    void reject(Call call, boolean rejectWithMessage, String message) {
        final String callId = mCallIdMapper.getCallId(call);
        if (callId != null && isServiceValid("reject")) {
            try {
                logOutgoing("reject %s", callId);

                if (rejectWithMessage && call.can(
                        android.telecom.Call.Details.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) {
                    mServiceInterface.rejectWithMessage(callId, message);
                } else {
                    mServiceInterface.reject(callId);
                }
            } catch (RemoteException e) {
            }
        }
+4 −2
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@ import android.os.Looper;
import android.os.RemoteException;
import android.os.Trace;
import android.os.UserHandle;
import android.telecom.AudioState;
import android.telecom.CallAudioState;
import android.telecom.Connection;
import android.telecom.DefaultDialerManager;
@@ -770,7 +769,10 @@ public final class InCallController extends CallsManagerListenerBase {
        android.telecom.Call.Details.CAPABILITY_CAN_UPGRADE_TO_VIDEO,

        Connection.CAPABILITY_CAN_PAUSE_VIDEO,
        android.telecom.Call.Details.CAPABILITY_CAN_PAUSE_VIDEO
        android.telecom.Call.Details.CAPABILITY_CAN_PAUSE_VIDEO,

        Connection.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION,
        android.telecom.Call.Details.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION
    };

    private static int convertConnectionToCallCapabilities(int connectionCapabilities) {
+4 −1
Original line number Diff line number Diff line
@@ -126,7 +126,10 @@ public class RespondViaSmsManager extends CallsManagerListenerBase {

    @Override
    public void onIncomingCallRejected(Call call, boolean rejectWithMessage, String textMessage) {
        if (rejectWithMessage && call.getHandle() != null) {
        if (rejectWithMessage
                && call.getHandle() != null
                && !call.can(
                        android.telecom.Call.Details.CAPABILITY_CAN_SEND_RESPONSE_VIA_CONNECTION)) {
            int subId = mCallsManager.getPhoneAccountRegistrar().getSubscriptionIdForPhoneAccount(
                    call.getTargetPhoneAccount());
            rejectCallWithMessage(call.getContext(), call.getHandle().getSchemeSpecificPart(),
+3 −0
Original line number Diff line number Diff line
@@ -106,6 +106,9 @@ public class ConnectionServiceFixture implements TestFixture<IConnectionService>
        @Override
        public void reject(String callId) throws RemoteException { }

        @Override
        public void rejectWithMessage(String callId, String message) throws RemoteException { }

        @Override
        public void disconnect(String callId) throws RemoteException { }