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

Commit 5dd6633e authored by Sandeep Kunta's avatar Sandeep Kunta Committed by Ed Carrigan
Browse files

MSIM(DSDA): Add conversation sub

Add conversation sub

Change-Id: I67f508baf66ba5ebc86a4f430af739d6ba8180ba
CRs-Fixed: 659123
parent a8f2ace6
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -2282,10 +2282,6 @@ public class CallManager {
        return false;
        return false;
    }
    }


    public void deactivateLchState(int sub) {
        Rlog.e(LOG_TAG, " deactivateLchState not supported");
    }

    public void startDtmf(char c, int subscription) {
    public void startDtmf(char c, int subscription) {
        Rlog.e(LOG_TAG, " startDtmf not supported for subscription");
        Rlog.e(LOG_TAG, " startDtmf not supported for subscription");
    }
    }
@@ -2293,4 +2289,13 @@ public class CallManager {
    public void stopDtmf(int subscription) {
    public void stopDtmf(int subscription) {
        Rlog.e(LOG_TAG, " stopDtmf not supported for subscription");
        Rlog.e(LOG_TAG, " stopDtmf not supported for subscription");
    }
    }

    public void setSubInConversation(int subscription) {
        Rlog.e(LOG_TAG, " setSubInConversation not supported");
    }

    public int getSubInConversation() {
        Rlog.e(LOG_TAG, " getSubInConversation not supported");
        return 0;
    }
}
}
+22 −17
Original line number Original line Diff line number Diff line
@@ -74,6 +74,10 @@ public class ExtCallManager extends CallManager {
    // taken on this sub.
    // taken on this sub.
    private static int mActiveSub = 0;
    private static int mActiveSub = 0;


    // Holds the subscription on which call is active (non-LCH).
    // When no subscription has active call (non-LCH), it holds INVALID_SUBSCRIPTION.
    private static int mSubInConversation = MSimConstants.INVALID_SUBSCRIPTION;

    // Holds the LCH status of subscription
    // Holds the LCH status of subscription
    private enum LchState {
    private enum LchState {
        INACTIVE,
        INACTIVE,
@@ -254,6 +258,19 @@ public class ExtCallManager extends CallManager {
        return mActiveSub;
        return mActiveSub;
    }
    }


    @Override
    public void setSubInConversation(int subscription) {
        Rlog.d(LOG_TAG, "setSubInConversation  existing:" + mSubInConversation + " new:"
                + subscription);
        mSubInConversation = subscription;
    }

    @Override
    public int getSubInConversation() {
        if (VDBG) Rlog.d(LOG_TAG, "getSubInConversation  = " + mSubInConversation);
        return mSubInConversation;
    }

    @Override
    @Override
    public boolean getLocalCallHoldStatus(int subscription) {
    public boolean getLocalCallHoldStatus(int subscription) {
        boolean status = false;
        boolean status = false;
@@ -273,7 +290,7 @@ public class ExtCallManager extends CallManager {
     * @param sub to be updated
     * @param sub to be updated
     * @param reserveLchState true to retain the previous lch state; otherwise false
     * @param reserveLchState true to retain the previous lch state; otherwise false
     */
     */
    private void updateLchStatus(int sub, boolean reserveLchState) {
    private void updateLchStatus(int sub) {
        LchState lchStatus = LchState.INACTIVE;
        LchState lchStatus = LchState.INACTIVE;
        Phone offHookPhone = getFgPhone(sub);
        Phone offHookPhone = getFgPhone(sub);
        Call call = offHookPhone.getForegroundCall();
        Call call = offHookPhone.getForegroundCall();
@@ -288,13 +305,10 @@ public class ExtCallManager extends CallManager {


        if ((state == Call.State.ACTIVE) || (state == Call.State.DIALING) ||
        if ((state == Call.State.ACTIVE) || (state == Call.State.DIALING) ||
                (state == Call.State.HOLDING) || (state == Call.State.ALERTING)) {
                (state == Call.State.HOLDING) || (state == Call.State.ALERTING)) {
            if (sub != getActiveSubscription()) {
            if (sub != getSubInConversation()) {
                // if sub is not an active sub and if it has an active
                // if sub is not conversation  sub and if it has an active
                // voice call then update lchStatus as Active
                // voice call then update lchStatus as Active
                lchStatus = LchState.ACTIVE;
                lchStatus = LchState.ACTIVE;
            } else if (reserveLchState == true){
                // otherwise don't change the lch status unless we really want to
                lchStatus = mLchStatus[sub];
            }
            }
        }
        }
        // Update state only if the new state is different
        // Update state only if the new state is different
@@ -307,17 +321,6 @@ public class ExtCallManager extends CallManager {
        }
        }
    }
    }


    private void updateLchStatus(int sub) {
        // set reserveLchState to true to reserve the lch state
        updateLchStatus(sub, true);
    }

    @Override
    public void deactivateLchState(int sub) {
        Rlog.d(LOG_TAG, "Deactivating Sub" + sub + "'s Lch state.");
        updateLchStatus(sub, false);
    }

    @Override
    @Override
    public void setAudioMode() {
    public void setAudioMode() {
        if (VDBG) Rlog.d(LOG_TAG, "in setAudioMode State = " + getState());
        if (VDBG) Rlog.d(LOG_TAG, "in setAudioMode State = " + getState());
@@ -503,6 +506,7 @@ public class ExtCallManager extends CallManager {


    @Override
    @Override
    public void acceptCall(Call ringingCall, int callType) throws CallStateException {
    public void acceptCall(Call ringingCall, int callType) throws CallStateException {
        setSubInConversation(ringingCall.getPhone().getSubscription());
        updateLchOnOtherSub(ringingCall.getPhone().getSubscription());
        updateLchOnOtherSub(ringingCall.getPhone().getSubscription());
        super.acceptCall(ringingCall, callType);
        super.acceptCall(ringingCall, callType);
    }
    }
@@ -556,6 +560,7 @@ public class ExtCallManager extends CallManager {
            }
            }
        }
        }


        setSubInConversation(subscription);
        updateLchOnOtherSub(subscription);
        updateLchOnOtherSub(subscription);


        if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
        if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {