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

Commit 0f8bfc50 authored by Sandeep Kunta's avatar Sandeep Kunta Committed by Linux Build Service Account
Browse files

Add support for DSDA.

1. Interface changes to inform local call hold and setActiveSubscription
telephony service from telecomm service.
2. Interface in Telecomm manager to query active subscription and switch
to other subscription.
3. Add support in PhoneAccount to maintain LCH & active subscription
information.
4. Interface changes to inform sub switch between inCallUI and Telecomm
service.

Conflicts:
telecomm/java/android/telecom/Call.java
telecomm/java/android/telecom/ParcelableCall.java
telecomm/java/android/telecom/Phone.java
telecomm/java/android/telecom/TelecomManager.java
telecomm/java/com/android/internal/telecom/IConnectionService.aidl
Change-Id: I942122eab45a19ea30abc92c90228d9115c1df78
Conflicts:
telecomm/java/com/android/internal/telecom/ITelecomService.aidl
parent 8e067590
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -728,13 +728,24 @@ public class ToneGenerator
     * @see #ToneGenerator(int, int)
     */
    public static final int TONE_CDMA_SIGNAL_OFF = 98;
    /**
     * SUPERVISORY_CH - 440Hz
     *
     * @hide #ToneGenerator(int, int)
     */
    public static final int TONE_SUPERVISORY_CH = 99;
    /**
     * HOLD_RECALL - 440Hz
     *
     * @hide #ToneGenerator(int, int)
     */
    public static final int TONE_HOLD_RECALL = 100;

    /** Maximum volume, for use with {@link #ToneGenerator(int,int)} */
    public static final int MAX_VOLUME = 100;
    /** Minimum volume setting, for use with {@link #ToneGenerator(int,int)} */
    public static final int MIN_VOLUME = 0;


    /**
     * ToneGenerator class contructor specifying output stream type and volume.
     *
+7 −2
Original line number Diff line number Diff line
@@ -390,6 +390,9 @@ public final class Call {
    private int mNotificationType;
    private int mNotificationCode;

    /** {@hide} */
    public boolean mIsActiveSub = false;

    /**
     * Obtains the post-dial sequence remaining to be emitted by this {@code Call}, if any.
     *
@@ -645,11 +648,12 @@ public final class Call {
    }

    /** {@hide} */
    Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter) {
    Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, boolean isActiveSub) {
        mPhone = phone;
        mTelecomCallId = telecomCallId;
        mInCallAdapter = inCallAdapter;
        mState = STATE_NEW;
        mIsActiveSub = isActiveSub;
    }

    /** {@hide} */
@@ -695,9 +699,10 @@ public final class Call {
        }

        int state = stateFromParcelableCallState(parcelableCall.getState());
        boolean stateChanged = mState != state;
        boolean stateChanged = (mState != state) || (mIsActiveSub != parcelableCall.mIsActiveSub);
        if (stateChanged) {
            mState = state;
            mIsActiveSub = parcelableCall.mIsActiveSub;
        }

        String parentId = parcelableCall.getParentCallId();
+12 −0
Original line number Diff line number Diff line
@@ -994,6 +994,18 @@ public abstract class Connection {
     */
    public void onStopDtmfTone() {}

    /**
     * Notifies this to set local call hold.
     * {@hide}
     */
    public void setLocalCallHold(int lchState) {}

    /**
     * Notifies this to set active subscription.
     * {@hide}
     */
    public void setActiveSubscription() {}

    /**
     * Notifies this Connection of a request to disconnect.
     */
+40 −0
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ public abstract class ConnectionService extends Service {
    private static final int MSG_ANSWER_VIDEO = 17;
    private static final int MSG_MERGE_CONFERENCE = 18;
    private static final int MSG_SWAP_CONFERENCE = 19;
    private static final int MSG_SET_LOCAL_HOLD = 20;
    private static final int MSG_SET_ACTIVE_SUB = 21;

    private static Connection sNullConnection;

@@ -174,6 +176,20 @@ public abstract class ConnectionService extends Service {
            mHandler.obtainMessage(MSG_STOP_DTMF_TONE, callId).sendToTarget();
        }

        @Override
        public void setLocalCallHold(String callId, int lchState) {
            SomeArgs args = SomeArgs.obtain();
            args.arg1 = callId;
            args.argi1 = lchState;
            mHandler.obtainMessage(MSG_SET_LOCAL_HOLD, args).sendToTarget();
        }

        @Override
        public void setActiveSubscription(String callId) {
            Log.i(this, "setActiveSubscription %s", callId);
            mHandler.obtainMessage(MSG_SET_ACTIVE_SUB, callId).sendToTarget();
        }

        @Override
        public void conference(String callId1, String callId2) {
            SomeArgs args = SomeArgs.obtain();
@@ -298,6 +314,20 @@ public abstract class ConnectionService extends Service {
                case MSG_STOP_DTMF_TONE:
                    stopDtmfTone((String) msg.obj);
                    break;
                case MSG_SET_LOCAL_HOLD: {
                    SomeArgs args = (SomeArgs) msg.obj;
                    try {
                        String callId = (String) args.arg1;
                        int lchStatus = args.argi1;
                        setLocalCallHold(callId, lchStatus);
                    } finally {
                        args.recycle();
                    }
                    break;
                }
                case MSG_SET_ACTIVE_SUB:
                    setActiveSubscription((String) msg.obj);
                    break;
                case MSG_CONFERENCE: {
                    SomeArgs args = (SomeArgs) msg.obj;
                    try {
@@ -685,6 +715,16 @@ public abstract class ConnectionService extends Service {
        }
    }

    private void setLocalCallHold(String callId, int lchStatus) {
        Log.d(this, "setLocalCallHold %s", callId);
        findConnectionForAction(callId, "setLocalCallHold").setLocalCallHold(lchStatus);
    }

    private void setActiveSubscription(String callId) {
        Log.d(this, "setActiveSubscription %s", callId);
        findConnectionForAction(callId, "setActiveSubscription").setActiveSubscription();
    }

    private void conference(String callId1, String callId2) {
        Log.d(this, "conference %s, %s", callId1, callId2);

+14 −0
Original line number Diff line number Diff line
@@ -271,4 +271,18 @@ public final class InCallAdapter {
        } catch (RemoteException ignored) {
        }
    }

    /**
     * Instructs Telecomm to switch to other active subscripion
     *
     * @param sub switch to this subscription
     * @param retainLch whether LCH on switched sub should be retained.
     * {@hide}
     */
    public void switchToOtherActiveSub(String sub, boolean retainLch) {
        try {
            mAdapter.switchToOtherActiveSub(sub, retainLch);
        } catch (RemoteException e) {
        }
    }
}
Loading