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

Commit bc38fbb3 authored by Hall Liu's avatar Hall Liu
Browse files

Inform NitzStateMachine of airplane mode changes

When the user toggles airplane mode, call a method in NitzStateMachine
to let it know that airplane mode has changed.

Bug: 133492648
Test: manual
Change-Id: I310810f84f512a8ecf64289dc549852cccc44325
parent aff096a5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ public interface NitzStateMachine {
     */
    void handleNitzReceived(TimestampedValue<NitzData> nitzSignal);

    /**
     * Handle the user putting the device into or out of airplane mode
     * @param on true if airplane mode has been turned on, false if it's been turned off.
     */
    void handleAirplaneModeChanged(boolean on);

    /**
     * Dumps the current in-memory state to the supplied PrintWriter.
     */
+6 −0
Original line number Diff line number Diff line
@@ -300,6 +300,12 @@ public final class NitzStateMachineImpl implements NitzStateMachine {
        updateTimeFromNitz();
    }

    @Override
    public void handleAirplaneModeChanged(boolean on) {
        Rlog.d(LOG_TAG, "handleAirplaneModeChanged: on=" + on);
        // TODO
    }

    private void updateTimeFromNitz() {
        TimestampedValue<NitzData> nitzSignal = mLatestNitzSignal;
        try {
+4 −0
Original line number Diff line number Diff line
@@ -1746,6 +1746,10 @@ public class ServiceStateTracker extends Handler {
        }
    }

    public void onAirplaneModeChanged(boolean isAirplaneModeOn) {
        mNitzState.handleAirplaneModeChanged(isAirplaneModeOn);
    }

    protected Phone getPhone() {
        return mPhone;
    }