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

Commit 8360d7fc authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "IMS:3-way Conf Success but Active call refer fails"

parents 6008687f 4a06f267
Loading
Loading
Loading
Loading
+40 −3
Original line number Diff line number Diff line
@@ -107,19 +107,40 @@ public final class ImsPhoneCallTracker extends CallTracker {

                    boolean isUnknown = intent.getBooleanExtra(ImsManager.EXTRA_IS_UNKNOWN_CALL,
                            false);
                    int phantomState = intent.getIntExtra(ImsManager.EXTRA_UNKNOWN_CALL_STATE, 0);
                    String address = intent.getStringExtra(ImsManager.EXTRA_UNKNOWN_CALL_ADDRESS);

                    if (DBG) {
                        log("onReceive : isUnknown = " + isUnknown +
                                " state = " + phantomState +
                                " fg = " + mForegroundCall.getState() +
                                " bg = " + mBackgroundCall.getState());
                                " bg = " + mBackgroundCall.getState() +
                                " address = " + address);
                    }

                    // Normal MT/Unknown call
                    ImsCall imsCall = mImsManager.takeCall(mServiceId, intent, mImsCallListener);
                    ImsPhoneCall.State state = convertIntToCallState(phantomState);

                    ImsPhoneCall call = null;

                    if (!isUnknown) {
                        call = mRingingCall;
                    } else if ((isUnknown) && (state == ImsPhoneCall.State.HOLDING)) {
                        call = mBackgroundCall;
                    } else {
                        call = mForegroundCall;
                    }

                    ImsPhoneConnection conn = new ImsPhoneConnection(mPhone.getContext(), imsCall,
                            ImsPhoneCallTracker.this,
                            (isUnknown? mForegroundCall: mRingingCall), isUnknown);
                            ImsPhoneCallTracker.this, call, isUnknown, state, address);

                    addConnection(conn);

                    // Updates mHold value in ImsCall for phantom held call scenario
                    if (isUnknown && (state == ImsPhoneCall.State.HOLDING)) {
                        imsCall.updateHoldValues();
                    }
                    setVideoCallProvider(conn, imsCall);

                    if (isUnknown) {
@@ -144,6 +165,22 @@ public final class ImsPhoneCallTracker extends CallTracker {
        }
    };

    private ImsPhoneCall.State convertIntToCallState(int state) {
        switch (state) {
            case ImsManager.CALL_ACTIVE:        return ImsPhoneCall.State.ACTIVE;
            case ImsManager.CALL_HOLD:          return ImsPhoneCall.State.HOLDING;
            case ImsManager.CALL_DIALING:       return ImsPhoneCall.State.DIALING;
            case ImsManager.CALL_ALERTING:      return ImsPhoneCall.State.ALERTING;
            case ImsManager.CALL_INCOMING:      return ImsPhoneCall.State.INCOMING;
            case ImsManager.CALL_WAITING:       return ImsPhoneCall.State.WAITING;
            default:
                {
                    log("convertIntToCallState: illegal call state:" + state);
                    return ImsPhoneCall.State.INCOMING;
                }
        }
    }

    //***** Constants

    static final int MAX_CONNECTIONS = 7;
+12 −4
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ public class ImsPhoneConnection extends Connection {
    /** This is probably an MT call */
    /*package*/
    ImsPhoneConnection(Context context, ImsCall imsCall, ImsPhoneCallTracker ct,
           ImsPhoneCall parent, boolean isUnknown) {
           ImsPhoneCall parent, boolean isUnknown, ImsPhoneCall.State state, String address) {
        createWakeLock(context);
        acquireWakeLock();

@@ -169,16 +169,24 @@ public class ImsPhoneConnection extends Connection {
            mCnapNamePresentation = PhoneConstants.PRESENTATION_UNKNOWN;
        }

        mIsIncoming = !isUnknown;
        mCreateTime = System.currentTimeMillis();
        mUusInfo = null;

        //mIndex = index;

        mParent = parent;
        mIsIncoming = !isUnknown;
        if (isUnknown) {
            mParent.attach(this, state);
            mAddress = address;
            mCnapName = address;
            mCnapNamePresentation = PhoneConstants.PRESENTATION_ALLOWED;
            mNumberPresentation = PhoneConstants.PRESENTATION_ALLOWED;
        } else {
            mParent.attach(this,
                    (mIsIncoming? ImsPhoneCall.State.INCOMING: ImsPhoneCall.State.DIALING));
        }
    }

    /** This is an MO call, created when dialing */
    /*package*/