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

Commit 0298692f authored by Daniel Bright's avatar Daniel Bright Committed by Gerrit Code Review
Browse files

Merge "Added onCallInitiating"

parents 9f721942 abe5d249
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -2774,10 +2774,33 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    private ImsCall.Listener mImsCallListener = new ImsCall.Listener() {
        boolean mOnCallInitiatingCalled = false;
        boolean mOnCallProgressingCalled = false;

        @Override
        public void onCallInitiating(ImsCall imsCall) {
            if (DBG) log("onCallInitiating");

            if (mOnCallInitiatingCalled) {
                throw new IllegalStateException("onCallInitiating cannot be called twice.");
            } else if (mOnCallProgressingCalled) {
                throw new IllegalStateException("onCallInitiating cannot be called after "
                        + "onCallProgressing has been called.");
            }
            mOnCallInitiatingCalled = true;

            mPendingMO = null;
            processCallStateChange(imsCall, ImsPhoneCall.State.DIALING,
                    DisconnectCause.NOT_DISCONNECTED, true);
            mMetrics.writeOnImsCallInitiating(mPhone.getPhoneId(), imsCall.getCallSession());
        }

        @Override
        public void onCallProgressing(ImsCall imsCall) {
            if (DBG) log("onCallProgressing");

            mOnCallProgressingCalled = true;

            mPendingMO = null;
            processCallStateChange(imsCall, ImsPhoneCall.State.ALERTING,
                    DisconnectCause.NOT_DISCONNECTED);
@@ -4200,6 +4223,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        Rlog.e(LOG_TAG, "[" + mPhone.getPhoneId() + "] " + msg);
    }

    void logw(String msg) {
        Rlog.w(LOG_TAG, "[" + mPhone.getPhoneId() + "] " + msg);
    }

    void logi(String msg) {
        Rlog.i(LOG_TAG, "[" + mPhone.getPhoneId() + "] " + msg);
    }
+1 −0
Original line number Diff line number Diff line
@@ -2782,6 +2782,7 @@ public class TelephonyMetrics {
    }

    //TODO: Expand the proto in the future
    public void writeOnImsCallInitiating(int phoneId, ImsCallSession session) {}
    public void writeOnImsCallProgressing(int phoneId, ImsCallSession session) {}
    public void writeOnImsCallStarted(int phoneId, ImsCallSession session) {}
    public void writeOnImsCallStartFailed(int phoneId, ImsCallSession session,