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

Commit 986da539 authored by Daniel Bright's avatar Daniel Bright
Browse files

Don't obtain ril request if request not supported

* Outstanding ril requests detect error conditions and
  recieve an onError callback that sends the consumer's
  message with an error code.
* On REQUEST_NOT_SUPPORTED cases, the consumer messsage is
  sent back with error code.
* Because of this redundancy, RilRequest.obtain should not
  be called in the REQUEST_NOT_SUPPORTED case, otherwise,
  the message can be sent twice causing a crash.

Test: telephony tests
Bug: 176924948
Change-Id: I69106ef005485205db3b4d189523c5daac4e430f
parent 7342ceb3
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -3526,14 +3526,6 @@ public class RIL extends BaseCommands implements CommandsInterface {
    public void isNrDualConnectivityEnabled(Message result, WorkSource workSource) {
        IRadio radioProxy = getRadioProxy(result);
        if (radioProxy != null) {
            RILRequest rr = obtainRequest(RIL_REQUEST_IS_NR_DUAL_CONNECTIVITY_ENABLED, result,
                    workSource == null ? mRILDefaultWorkSource : workSource);

            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> "
                        + requestToString(rr.mRequest));
            }

            if (mRadioVersion.less(RADIO_HAL_VERSION_1_6)) {
                if (result != null) {
                    AsyncResult.forMessage(result, null,
@@ -3545,6 +3537,15 @@ public class RIL extends BaseCommands implements CommandsInterface {

            android.hardware.radio.V1_6.IRadio radioProxy16 =
                    (android.hardware.radio.V1_6.IRadio) radioProxy;

            RILRequest rr = obtainRequest(RIL_REQUEST_IS_NR_DUAL_CONNECTIVITY_ENABLED, result,
                    workSource == null ? mRILDefaultWorkSource : workSource);

            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> "
                        + requestToString(rr.mRequest));
            }

            try {
                radioProxy16.isNrDualConnectivityEnabled(rr.mSerial);
            } catch (RemoteException | RuntimeException e) {