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

Commit c39a1826 authored by Hall Liu's avatar Hall Liu Committed by Gerrit Code Review
Browse files

Merge "Add null checks for getImsCall()"

parents 4fa28340 6735c802
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -982,9 +982,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
@@ -996,6 +999,7 @@ public class ImsPhoneConnection extends Connection implements
        boolean accept = textStream != null;
        ImsCall imsCall = getImsCall();

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

    public void onRttMessageReceived(String message) {
        synchronized (this) {
@@ -1055,7 +1060,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);
    }