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

Commit ae24e8a3 authored by Brian's avatar Brian
Browse files

Fix notification airplane mode toggle to send the proper state, in turn fixing...

Fix notification airplane mode toggle to send the proper state, in turn fixing toggling of 4G when entering/leaving airplane mode.

The state in the broadcast intent was backwards.
It didn't affect the toggling of other radios, because they ignore the
intent payload and check the system setting.  4G toggling does use the
state extra, so it was turning 4G on when airplane mode was enabled,
and 4G off when airplane mode was disabled via the notification widget.

Change-Id: Ifda805136c08b7f427d44f539843a50512d3bf20
parent ebc61e13
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ public class AirplaneButton extends PowerButton {
            Settings.System.AIRPLANE_MODE_ON, state ? 0 : 1);
        // notify change
        Intent intent = new Intent(Intent.ACTION_AIRPLANE_MODE_CHANGED);
        intent.putExtra("state", state);
        // Reverse state when sending the intent, since we grabbed it before the toggle.
        intent.putExtra("state", !state);
        context.sendBroadcast(intent);
    }