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

Commit 288319f6 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by The Android Automerger
Browse files

Fix tethering

Using sendMessageAtFrontofQueue() causes issues here since there can be a start
that is deferred and it basically has no effect. Use defer which is more clean
and obvious here.

Bug: 8410547
Change-Id: I4fbf299283847e7c3009b87a81cb56e765b0e1e1
parent 6ebcfdec
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -3584,6 +3584,8 @@ public class WifiStateMachine extends StateMachine {
                    setWifiApState(WIFI_AP_STATE_DISABLING);
                    stopTethering();
                    transitionTo(mUntetheringState);
                    // More work to do after untethering
                    deferMessage(message);
                    break;
                default:
                    return NOT_HANDLED;
@@ -3610,15 +3612,11 @@ public class WifiStateMachine extends StateMachine {
                    if (isWifiTethered(stateChange.active)) break;

                    transitionTo(mSoftApStartedState);
                    // Needs to be first thing handled
                    sendMessageAtFrontOfQueue(CMD_STOP_AP);
                    break;
                case CMD_TETHER_NOTIFICATION_TIMED_OUT:
                    if (message.arg1 == mTetherToken) {
                        loge("Failed to get tether update, force stop access point");
                        transitionTo(mSoftApStartedState);
                        // Needs to be first thing handled
                        sendMessageAtFrontOfQueue(CMD_STOP_AP);
                    }
                    break;
                case CMD_START_SUPPLICANT: