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

Commit 5e22d71a authored by Pavel Zhamaitsiak's avatar Pavel Zhamaitsiak Committed by Android (Google) Code Review
Browse files

Merge "Add missing null checks to ImsPhoneCallTracker" into nyc-mr1-dev

parents b6c7afcb cf3a2925
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -810,6 +810,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    //***** Called from ImsPhone

    public void setUiTTYMode(int uiTtyMode, Message onComplete) {
        if (mImsManager == null) {
            mPhone.sendErrorResponse(onComplete, getImsManagerIsNullException());
            return;
        }

        try {
            mImsManager.setUiTTYMode(mPhone.getContext(), mServiceId, uiTtyMode, onComplete);
        } catch (ImsException e) {
@@ -992,6 +997,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                return;
            }

            if (mImsManager == null) {
                mPhone.sendErrorResponse(response, getImsManagerIsNullException());
                return;
            }

            String[] callees = new String[] { ussdString };
            ImsCallProfile profile = mImsManager.createCallProfile(mServiceId,
                    ImsCallProfile.SERVICE_TYPE_NORMAL, ImsCallProfile.CALL_TYPE_VOICE);
@@ -1861,7 +1871,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

    public ImsUtInterface getUtInterface() throws ImsException {
        if (mImsManager == null) {
            throw new ImsException("no ims manager", ImsReasonInfo.CODE_UNSPECIFIED);
            throw getImsManagerIsNullException();
        }

        ImsUtInterface ut = mImsManager.getSupplementaryServiceConfiguration(mServiceId);
@@ -2053,7 +2063,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    /* package */
    ImsEcbm getEcbmInterface() throws ImsException {
        if (mImsManager == null) {
            throw new ImsException("no ims manager", ImsReasonInfo.CODE_UNSPECIFIED);
            throw getImsManagerIsNullException();
        }

        ImsEcbm ecbm = mImsManager.getEcbmInterface(mServiceId);
@@ -2063,7 +2073,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    /* package */
    ImsMultiEndpoint getMultiEndpointInterface() throws ImsException {
        if (mImsManager == null) {
            throw new ImsException("no ims manager", ImsReasonInfo.CODE_UNSPECIFIED);
            throw getImsManagerIsNullException();
        }

        try {
@@ -2204,4 +2214,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            loge("pullExternalCall failed - " + e);
        }
    }

    private ImsException getImsManagerIsNullException() {
        return new ImsException("no ims manager", ImsReasonInfo.CODE_LOCAL_ILLEGAL_STATE);
    }
}