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

Commit 8b29c937 authored by Nathan Harold's avatar Nathan Harold Committed by Gerrit Code Review
Browse files

Merge "Always call processResponseDone() NATT Responses"

parents 36f57c05 0edd55aa
Loading
Loading
Loading
Loading
+34 −35
Original line number Diff line number Diff line
@@ -1313,13 +1313,10 @@ public class RadioResponse extends IRadioResponse.Stub {
            android.hardware.radio.V1_1.KeepaliveStatus keepaliveStatus) {

        RILRequest rr = mRil.processResponse(responseInfo);

        if (rr == null) {
            return;
        }
        if (rr == null) return;

        KeepaliveStatus ret = null;

        try {
            switch(responseInfo.error) {
                case RadioError.NONE:
                    int convertedStatus = convertHalKeepaliveStatusCode(keepaliveStatus.code);
@@ -1342,26 +1339,28 @@ public class RadioResponse extends IRadioResponse.Stub {
                    ret = new KeepaliveStatus(KeepaliveStatus.ERROR_UNKNOWN);
                    break;
            }
        } finally {
            // If responseInfo.error != NONE, the processResponseDone sends the response message.
            mRil.processResponseDone(rr, responseInfo, ret);
        }
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error
     */
    public void stopKeepaliveResponse(RadioResponseInfo responseInfo) {
        RILRequest rr = mRil.processResponse(responseInfo);
        if (rr == null) return;

        if (rr == null) {
            return;
        }

        try {
            if (responseInfo.error == RadioError.NONE) {
                sendMessageResponse(rr.mResult, null);
            mRil.processResponseDone(rr, responseInfo, null);
            } else {
                //TODO: Error code translation
            }
        } finally {
            mRil.processResponseDone(rr, responseInfo, null);
        }
    }

    private int convertHalKeepaliveStatusCode(int halCode) {