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

Commit 168e3607 authored by Arne Coucheron's avatar Arne Coucheron
Browse files

Telephony: Add option for using regular poll state for airplane mode

The modemTriggeredPollState breaks airplane mode on some devices.
Although the UI shows that airplane mode is activated, the fact is that
the radio remains active and in service. By using regular pollState()
here, service state in sim status shows correctly radio off.

Enable with setting prop:
ro.telephony.ril.config=legacypollstate

Test: Insert SIM card. Put device into airplane mode. Go into
SIM Status and verify that it says "Radio off".

Change-Id: If2ab5b088a13b1a159e01f82fbea1f58a77b64cd
parent 3afcb022
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -1270,8 +1270,14 @@ public class ServiceStateTracker extends Handler {
                }
                // This will do nothing in the 'radio not available' case
                setPowerStateToDesired();
                if (needsLegacyPollState()) {
                    // Some older radio blobs need this to put device
                    // properly into airplane mode.
                    pollState();
                } else {
                    // These events are modem triggered, so pollState() needs to be forced
                    pollStateInternal(true);
                }
                break;

            case EVENT_NETWORK_STATE_CHANGED:
@@ -5808,4 +5814,11 @@ public class ServiceStateTracker extends Handler {
        values.put(SERVICE_STATE, p.marshall());
        return values;
    }

    private boolean needsLegacyPollState() {
        if (mCi instanceof RIL) {
            return ((RIL) mCi).needsOldRilFeature("legacypollstate");
        }
        return false;
    }
}