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

Commit 14c651fe authored by Sandeep Kunta's avatar Sandeep Kunta Committed by Gerrit - the friendly Code Review server
Browse files

Update LCH properly on active subscription

When active sub is in LCH, and call is disconnected on other sub before
going into dialing state, then remove active subscription from LCH.

CRs-Fixed: 761725 764489
Change-Id: I6160e5692d29b92c5c9ead6ea076694a0fcf2854
parent 35adbf35
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -920,15 +920,22 @@ public final class CallsManager extends Call.ListenerBase {
    void markCallAsDisconnected(Call call, DisconnectCause disconnectCause) {
        call.setDisconnectCause(disconnectCause);
        setCallState(call, CallState.DISCONNECTED);
        String activeSub = getActiveSubscription();
        String conversationSub = getConversationSub();
        PhoneAccount phAcc =
                 getPhoneAccountRegistrar().getPhoneAccount(call.getTargetPhoneAccount());
        if ((call.getTargetPhoneAccount() != null &&
                    call.getTargetPhoneAccount().getId().equals(getActiveSubscription())) &&
                    call.getTargetPhoneAccount().getId().equals(activeSub)) &&
                    (phAcc != null) && (phAcc.isSet(PhoneAccount.LCH)) &&
                    (getConversationSub() != null) &&
                    (!getConversationSub().equals(getActiveSubscription()))) {
                    (conversationSub != null) &&
                    (!conversationSub.equals(activeSub))) {
            Log.d(this,"Set active sub to conversation sub");
            setActiveSubscription(getConversationSub());
            setActiveSubscription(conversationSub);
        } else if ((conversationSub == null) && (call.getTargetPhoneAccount() != null) &&
                (activeSub != null) && (!call.getTargetPhoneAccount().getId().equals(activeSub))) {
            Log.d(this,"remove active sub from LCH");
            updateLchStatus(activeSub);
            manageMSimInCallTones(false);
        }

        if ((call.getTargetPhoneAccount() != null) && (phAcc != null) &&