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

Commit 808f1058 authored by Hall Liu's avatar Hall Liu Committed by Android (Google) Code Review
Browse files

Merge "Add null checks for getImsCall()" into pi-dev

parents 4dd19627 6df96dde
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -973,9 +973,12 @@ public class ImsPhoneConnection extends Connection implements
    }

    public void sendRttModifyRequest(android.telecom.Connection.RttTextStream textStream) {
        ImsCall imsCall = getImsCall();
        if (imsCall != null) {
            getImsCall().sendRttModifyRequest();
            setCurrentRttTextStream(textStream);
        }
    }

    /**
     * Sends the user's response to a remotely-issued RTT upgrade request
@@ -987,6 +990,7 @@ public class ImsPhoneConnection extends Connection implements
        boolean accept = textStream != null;
        ImsCall imsCall = getImsCall();

        if (imsCall != null) {
            imsCall.sendRttModifyResponse(accept);
            if (accept) {
                setCurrentRttTextStream(textStream);
@@ -994,6 +998,7 @@ public class ImsPhoneConnection extends Connection implements
                Rlog.e(LOG_TAG, "sendRttModifyResponse: foreground call has no connections");
            }
        }
    }

    public void onRttMessageReceived(String message) {
        synchronized (this) {
@@ -1046,7 +1051,12 @@ public class ImsPhoneConnection extends Connection implements
    // Make sure to synchronize on ImsPhoneConnection.this before calling.
    private void createRttTextHandler() {
        mRttTextHandler = new ImsRttTextHandler(Looper.getMainLooper(),
                (message) -> getImsCall().sendRttMessage(message));
                (message) -> {
                    ImsCall imsCall = getImsCall();
                    if (imsCall != null) {
                        imsCall.sendRttMessage(message);
                    }
                });
        mRttTextHandler.initialize(mRttTextStream);
    }