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

Commit 2c63e9f0 authored by Ling Ma's avatar Ling Ma
Browse files

Check whether radio available before whether request supported

For devices that dont have modems, RADIO_NOT_AVAILABLE should be returned instead of REQUEST_NOT_SUPPORTED, so check whether modem service available first.

Fix: 333896565
Test: basic voice call + data browsing
Change-Id: Ieec2aae6d48327fb4005e59cacfc9873c736e160
parent fd892335
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -1292,23 +1292,22 @@ public class RIL extends BaseCommands implements CommandsInterface {
        } else if (proxy instanceof RadioImsProxy) {
            service = HAL_SERVICE_IMS;
        }

        if (mHalVersion.get(service).less(version)) {
            riljLoge(String.format("%s not supported on service %s < %s.",
                    request, serviceToString(service), version));
        if (proxy == null || proxy.isEmpty()) {
            riljLoge(String.format("Unable to complete %s because service %s is not available.",
                    request, serviceToString(service)));
            if (result != null) {
                AsyncResult.forMessage(result, null,
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                result.sendToTarget();
            }
            return false;
        }
        if (proxy == null || proxy.isEmpty()) {
            riljLoge(String.format("Unable to complete %s because service %s is not available.",
                    request, serviceToString(service)));
        if (mHalVersion.get(service).less(version)) {
            riljLoge(String.format("%s not supported on service %s < %s.",
                    request, serviceToString(service), version));
            if (result != null) {
                AsyncResult.forMessage(result, null,
                        CommandException.fromRilErrno(RADIO_NOT_AVAILABLE));
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                result.sendToTarget();
            }
            return false;