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

Commit 48a17d6b authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Do not call getService() on wifi-only device."

parents 8caf74e5 0ef065b1
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -787,6 +787,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    boolean mIsMobileNetworkSupported;
    RadioResponse mRadioResponse;
    RadioIndication mRadioIndication;
    volatile IRadio mRadioProxy = null;
@@ -833,6 +834,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {
    }

    private IRadio getRadioProxy(Message result) {
        if (!mIsMobileNetworkSupported) {
            if (RILJ_LOGV) riljLog("Not calling getService(): wifi-only");
            return null;
        }

        if (mRadioProxy != null) {
            return mRadioProxy;
        }
@@ -884,6 +890,10 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        mPhoneType = RILConstants.NO_PHONE;
        mPhoneId = instanceId;

        ConnectivityManager cm = (ConnectivityManager)context.getSystemService(
                Context.CONNECTIVITY_SERVICE);
        mIsMobileNetworkSupported = cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);

        mRadioResponse = new RadioResponse(this);
        mRadioIndication = new RadioIndication(this);
        mRilHandler = new RilHandler();
@@ -909,9 +919,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
        Looper looper = mSenderThread.getLooper();
        mSender = new RILSender(looper);

        ConnectivityManager cm = (ConnectivityManager)context.getSystemService(
                Context.CONNECTIVITY_SERVICE);
        if (cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false) {
        if (!mIsMobileNetworkSupported) {
            riljLog("Not starting RILReceiver: wifi-only");
        } else {
            riljLog("Starting RILReceiver" + mPhoneId);