Integrate SoftApManager to WifiStateMachine
Refactor WifiStateMachine to use SoftApManager for managing soft AP
instance. This consolidate all soft AP related states in WifiStateMachine
to a single SoftApState.
While there, fix number of existing issues in WifiController:
- fix a possible race condition in WifiController where it will
transition to a new state before AP is completely stopped. Currently it is
being worked around in WifiStateMachine by having the soft AP states defer
the commands that might be issued during this race window. This doesn't
really scale and not really clear to the reader. Fix it by only transition
out of ApEnabledState when AP is completely stopped.
- fix a bug in WifiController where it doesn't transition out of
ApEnabledState when AP is stopped internally (either tether notification
timed out or WiFi becomes untethered), results in WifiController and
WifiStateMachine being out of sync.
- fix couple unintentional fall through case statements.
TEST=run frameworks-wifi test
3 files changed