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

Commit ba0f9d29 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "IMS: Add support in frameworks for call deflection feature"

parents 18f8500e d34698de
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -39129,6 +39129,7 @@ package android.telecom {
  public final class Call {
    method public void answer(int);
    method public void conference(android.telecom.Call);
    method public void deflect(android.net.Uri);
    method public void disconnect();
    method public java.util.List<java.lang.String> getCannedTextResponses();
    method public java.util.List<android.telecom.Call> getChildren();
@@ -39239,6 +39240,7 @@ package android.telecom {
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800
    field public static final int CAPABILITY_SUPPORT_DEFLECT = 16777216; // 0x1000000
    field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2
    field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8
    field public static final int PROPERTY_CONFERENCE = 1; // 0x1
@@ -39384,6 +39386,7 @@ package android.telecom {
    method public void onAnswer();
    method public void onCallAudioStateChanged(android.telecom.CallAudioState);
    method public void onCallEvent(java.lang.String, android.os.Bundle);
    method public void onDeflect(android.net.Uri);
    method public void onDisconnect();
    method public void onExtrasChanged(android.os.Bundle);
    method public void onHandoverComplete();
@@ -39446,6 +39449,7 @@ package android.telecom {
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_BIDIRECTIONAL = 3072; // 0xc00
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_RX = 1024; // 0x400
    field public static final int CAPABILITY_SUPPORTS_VT_REMOTE_TX = 2048; // 0x800
    field public static final int CAPABILITY_SUPPORT_DEFLECT = 33554432; // 0x2000000
    field public static final int CAPABILITY_SUPPORT_HOLD = 2; // 0x2
    field public static final int CAPABILITY_SWAP_CONFERENCE = 8; // 0x8
    field public static final java.lang.String EVENT_CALL_MERGE_FAILED = "android.telecom.event.CALL_MERGE_FAILED";
+1 −0
Original line number Diff line number Diff line
@@ -4863,6 +4863,7 @@ package android.telephony.ims.stub {
    ctor public ImsCallSessionImplBase();
    method public void accept(int, android.telephony.ims.ImsStreamMediaProfile);
    method public void close();
    method public void deflect(java.lang.String);
    method public void extendToConference(java.lang.String[]);
    method public java.lang.String getCallId();
    method public android.telephony.ims.ImsCallProfile getCallProfile();
+16 −1
Original line number Diff line number Diff line
@@ -352,8 +352,11 @@ public final class Call {
         */
        public static final int CAPABILITY_CAN_PULL_CALL = 0x00800000;

        /** Call supports the deflect feature. */
        public static final int CAPABILITY_SUPPORT_DEFLECT = 0x01000000;

        //******************************************************************************************
        // Next CAPABILITY value: 0x01000000
        // Next CAPABILITY value: 0x02000000
        //******************************************************************************************

        /**
@@ -529,6 +532,9 @@ public final class Call {
            if (can(capabilities, CAPABILITY_CAN_PULL_CALL)) {
                builder.append(" CAPABILITY_CAN_PULL_CALL");
            }
            if (can(capabilities, CAPABILITY_SUPPORT_DEFLECT)) {
                builder.append(" CAPABILITY_SUPPORT_DEFLECT");
            }
            builder.append("]");
            return builder.toString();
        }
@@ -1235,6 +1241,15 @@ public final class Call {
        mInCallAdapter.answerCall(mTelecomCallId, videoState);
    }

    /**
     * Instructs this {@link #STATE_RINGING} {@code Call} to deflect.
     *
     * @param address The address to which the call will be deflected.
     */
    public void deflect(Uri address) {
        mInCallAdapter.deflectCall(mTelecomCallId, address);
    }

    /**
     * Instructs this {@link #STATE_RINGING} {@code Call} to reject.
     *
+13 −1
Original line number Diff line number Diff line
@@ -328,8 +328,11 @@ public abstract class Connection extends Conferenceable {
     */
    public static final int CAPABILITY_CAN_PULL_CALL = 0x01000000;

    /** Call supports the deflect feature. */
    public static final int CAPABILITY_SUPPORT_DEFLECT = 0x02000000;

    //**********************************************************************************************
    // Next CAPABILITY value: 0x02000000
    // Next CAPABILITY value: 0x04000000
    //**********************************************************************************************

    /**
@@ -729,6 +732,9 @@ public abstract class Connection extends Conferenceable {
        if (can(capabilities, CAPABILITY_CAN_PULL_CALL)) {
            builder.append(isLong ? " CAPABILITY_CAN_PULL_CALL" : " pull");
        }
        if (can(capabilities, CAPABILITY_SUPPORT_DEFLECT)) {
            builder.append(isLong ? " CAPABILITY_SUPPORT_DEFLECT" : " sup_def");
        }

        builder.append("]");
        return builder.toString();
@@ -2744,6 +2750,12 @@ public abstract class Connection extends Conferenceable {
        onAnswer(VideoProfile.STATE_AUDIO_ONLY);
    }

    /**
     * Notifies this Connection, which is in {@link #STATE_RINGING}, of
     * a request to deflect.
     */
    public void onDeflect(Uri address) {}

    /**
     * Notifies this Connection, which is in {@link #STATE_RINGING}, of
     * a request to reject.
+32 −0
Original line number Diff line number Diff line
@@ -124,6 +124,7 @@ public abstract class ConnectionService extends Service {
    private static final String SESSION_ABORT = "CS.ab";
    private static final String SESSION_ANSWER = "CS.an";
    private static final String SESSION_ANSWER_VIDEO = "CS.anV";
    private static final String SESSION_DEFLECT = "CS.def";
    private static final String SESSION_REJECT = "CS.r";
    private static final String SESSION_REJECT_MESSAGE = "CS.rWM";
    private static final String SESSION_SILENCE = "CS.s";
@@ -181,6 +182,7 @@ public abstract class ConnectionService extends Service {
    private static final int MSG_CONNECTION_SERVICE_FOCUS_GAINED = 31;
    private static final int MSG_HANDOVER_FAILED = 32;
    private static final int MSG_HANDOVER_COMPLETE = 33;
    private static final int MSG_DEFLECT = 34;

    private static Connection sNullConnection;

@@ -352,6 +354,20 @@ public abstract class ConnectionService extends Service {
            }
        }

        @Override
        public void deflect(String callId, Uri address, Session.Info sessionInfo) {
            Log.startSession(sessionInfo, SESSION_DEFLECT);
            try {
                SomeArgs args = SomeArgs.obtain();
                args.arg1 = callId;
                args.arg2 = address;
                args.arg3 = Log.createSubsession();
                mHandler.obtainMessage(MSG_DEFLECT, args).sendToTarget();
            } finally {
                Log.endSession();
            }
        }

        @Override
        public void reject(String callId, Session.Info sessionInfo) {
            Log.startSession(sessionInfo, SESSION_REJECT);
@@ -847,6 +863,17 @@ public abstract class ConnectionService extends Service {
                    }
                    break;
                }
                case MSG_DEFLECT: {
                    SomeArgs args = (SomeArgs) msg.obj;
                    Log.continueSession((Session) args.arg3, SESSION_HANDLER + SESSION_DEFLECT);
                    try {
                        deflect((String) args.arg1, (Uri) args.arg2);
                    } finally {
                        args.recycle();
                        Log.endSession();
                    }
                    break;
                }
                case MSG_REJECT: {
                    SomeArgs args = (SomeArgs) msg.obj;
                    Log.continueSession((Session) args.arg2, SESSION_HANDLER + SESSION_REJECT);
@@ -1605,6 +1632,11 @@ public abstract class ConnectionService extends Service {
        findConnectionForAction(callId, "answer").onAnswer();
    }

    private void deflect(String callId, Uri address) {
        Log.d(this, "deflect %s", callId);
        findConnectionForAction(callId, "deflect").onDeflect(address);
    }

    private void reject(String callId) {
        Log.d(this, "reject %s", callId);
        findConnectionForAction(callId, "reject").onReject();
Loading