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

Commit 2f7270f2 authored by Sandeep Kunta's avatar Sandeep Kunta Committed by Linux Build Service Account
Browse files

MSIM: Add support for DSDA.

1. Interface changes to inform local call hold and setActiveSubscription
to 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.

Change-Id: I942122eab45a19ea30abc92c90228d9115c1df78
parent 551189e7
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 = 100;
    /**
     * HOLD_RECALL - 440Hz
     *
     * @hide #ToneGenerator(int, int)
     */
    public static final int TONE_HOLD_RECALL = 101;

    /** 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.
     *
+29 −3
Original line number Diff line number Diff line
@@ -690,6 +690,28 @@ public final class Call {
    private InCallService.VideoCall mVideoCall;
    private Details mDetails;

    /**
      * when mIsActiveSub True indicates this call belongs to active subscription
      * Calls belonging to active subscription are shown to user.
      */
    private boolean mIsActiveSub = false;

    /**
     * Set this call object as active subscription.
     * @hide
     */
    public void setActive() {
        mIsActiveSub = true;
    }

    /**
     *  return if this call object belongs to active subscription.
     * @hide
     */
    public boolean isActive() {
        return mIsActiveSub;
    }

    /**
     * Obtains the post-dial sequence remaining to be emitted by this {@code Call}, if any.
     *
@@ -980,19 +1002,22 @@ 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} */
    Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state) {
    Call(Phone phone, String telecomCallId, InCallAdapter inCallAdapter, int state,
             boolean isActiveSub) {
        mPhone = phone;
        mTelecomCallId = telecomCallId;
        mInCallAdapter = inCallAdapter;
        mState = state;
        mIsActiveSub = isActiveSub;
    }

    /** {@hide} */
@@ -1037,9 +1062,10 @@ public final class Call {
        }

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

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

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

    /**
     * Notifies this Connection of a request to disconnect.
     */
+25 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ 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 Connection sNullConnection;

@@ -198,6 +199,14 @@ public abstract class ConnectionService extends Service {
            mHandler.obtainMessage(MSG_STOP_DTMF_TONE, callId).sendToTarget();
        }

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

        @Override
        public void conference(String callId1, String callId2) {
            SomeArgs args = SomeArgs.obtain();
@@ -322,6 +331,17 @@ 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;
                        boolean lchStatus = (args.argi1 == 1);
                        setLocalCallHold(callId, lchStatus);
                    } finally {
                        args.recycle();
                    }
                    break;
                }
                case MSG_CONFERENCE: {
                    SomeArgs args = (SomeArgs) msg.obj;
                    try {
@@ -737,6 +757,11 @@ public abstract class ConnectionService extends Service {
        }
    }

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

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

+13 −0
Original line number Diff line number Diff line
@@ -273,4 +273,17 @@ public final class InCallAdapter {
        } catch (RemoteException ignored) {
        }
    }

    /**
     * Instructs Telecomm to switch to other active subscripion
     *
     * @param subid switch to subscription denoted by subId
     * {@hide}
     */
    public void switchToOtherActiveSub(String subId) {
        try {
            mAdapter.switchToOtherActiveSub(subId);
        } catch (RemoteException e) {
        }
    }
}
Loading