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

Commit 96a968d2 authored by Shuo Qian's avatar Shuo Qian Committed by Gerrit Code Review
Browse files

Merge "Use CallTracker instead of mParent to get Phone in Connection for emergency calling flow."

parents 935c4c5f abd4f615
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -101,6 +101,8 @@ public abstract class CallTracker extends Handler {

    protected abstract void handlePollCalls(AsyncResult ar);

    protected abstract Phone getPhone();

    protected Connection getHoConnection(DriverCall dc) {
        for (Connection hoConn : mHandoverConnections) {
            log("getHoConnection - compare number: hoConn= " + hoConn.toString());
+11 −4
Original line number Diff line number Diff line
@@ -506,10 +506,9 @@ public abstract class Connection {
     *
     * @hide
     */
    public void setEmergencyCallInfo() {
        Call call = getCall();
        if (call != null) {
            Phone phone = call.getPhone();
    public void setEmergencyCallInfo(CallTracker ct) {
        if (ct != null) {
            Phone phone = ct.getPhone();
            if (phone != null) {
                EmergencyNumberTracker tracker = phone.getEmergencyNumberTracker();
                if (tracker != null) {
@@ -517,9 +516,17 @@ public abstract class Connection {
                    if (num != null) {
                        mIsEmergencyCall = true;
                        mEmergencyNumberInfo = num;
                    } else {
                        Rlog.e(TAG, "setEmergencyCallInfo: emergency number is null");
                    }
                } else {
                    Rlog.e(TAG, "setEmergencyCallInfo: emergency number tracker is null");
                }
            } else {
                Rlog.e(TAG, "setEmergencyCallInfo: phone is null");
            }
        } else {
            Rlog.e(TAG, "setEmergencyCallInfo: call tracker is null");
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -1748,6 +1748,7 @@ public class GsmCdmaCallTracker extends CallTracker {
    }

    @UnsupportedAppUsage
    @Override
    public GsmCdmaPhone getPhone() {
        return mPhone;
    }
+2 −2
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ public class GsmCdmaConnection extends Connection {
        mHandler = new MyHandler(mOwner.getLooper());

        mAddress = dc.number;
        setEmergencyCallInfo();
        setEmergencyCallInfo(mOwner);

        mIsIncoming = dc.isMT;
        mCreateTime = System.currentTimeMillis();
@@ -179,7 +179,7 @@ public class GsmCdmaConnection extends Connection {

        mAddress = PhoneNumberUtils.extractNetworkPortionAlt(dialString);
        if (isEmergencyCall) {
            setEmergencyCallInfo();
            setEmergencyCallInfo(mOwner);
        }

        mPostDialString = PhoneNumberUtils.extractPostDialPortion(dialString);
+1 −0
Original line number Diff line number Diff line
@@ -4213,6 +4213,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        return countryIso;
    }

    @Override
    public ImsPhone getPhone() {
        return mPhone;
    }
Loading