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

Commit 97c2fdfc authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 2957 into donut

* changes:
  Allow response payload on RIL_REQUEST error
parents 2c159ec0 03228fa8
Loading
Loading
Loading
Loading
+27 −24
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ class RILRequest {
    }

    void
    onError(int error) {
    onError(int error, Object ret) {
        CommandException ex;

        ex = CommandException.fromRilErrno(error);
@@ -175,7 +175,7 @@ class RILRequest {
            + " error: " + ex);

        if (mResult != null) {
            AsyncResult.forMessage(mResult, null, ex);
            AsyncResult.forMessage(mResult, ret, ex);
            mResult.sendToTarget();
        }

@@ -290,7 +290,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                        s = mSocket;

                        if (s == null) {
                            rr.onError(RADIO_NOT_AVAILABLE);
                            rr.onError(RADIO_NOT_AVAILABLE, null);
                            rr.release();
                            mRequestMessagesPending--;
                            alreadySubtracted = true;
@@ -331,7 +331,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                        // make sure this request has not already been handled,
                        // eg, if RILReceiver cleared the list.
                        if (req != null || !alreadySubtracted) {
                            rr.onError(RADIO_NOT_AVAILABLE);
                            rr.onError(RADIO_NOT_AVAILABLE, null);
                            rr.release();
                        }
                    } catch (RuntimeException exc) {
@@ -340,7 +340,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                        // make sure this request has not already been handled,
                        // eg, if RILReceiver cleared the list.
                        if (req != null || !alreadySubtracted) {
                            rr.onError(GENERIC_FAILURE);
                            rr.onError(GENERIC_FAILURE, null);
                            rr.release();
                        }
                    }
@@ -545,7 +545,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                synchronized (mRequestsList) {
                    for (int i = 0, sz = mRequestsList.size() ; i < sz ; i++) {
                        RILRequest rr = mRequestsList.get(i);
                        rr.onError(RADIO_NOT_AVAILABLE);
                        rr.onError(RADIO_NOT_AVAILABLE, null);
                        rr.release();
                    }

@@ -1986,14 +1986,10 @@ public final class RIL extends BaseCommands implements CommandsInterface {
            return;
        }

        if (error != 0) {
            rr.onError(error);
            rr.release();
            return;
        }

        Object ret;
        Object ret = null;

        if (error == 0 || p.dataAvail() > 0) {
            // either command succeeds or command fails but with data payload
            try {switch (rr.mRequest) {
            /*
 cat libs/telephony/ril_commands.h \
@@ -2118,6 +2114,13 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                rr.release();
                return;
            }
        }

        if (error != 0) {
            rr.onError(error, ret);
            rr.release();
            return;
        }

        if (RILJ_LOGD) riljLog(rr.serialString() + "< " + requestToString(rr.mRequest)
            + " " + retToString(rr.mRequest, ret));