ClientModeManager: Invoke onStarted() callback only after setting role
ActiveModeWarden on getting the onStarted() needs to evaluate whether
scanner needs to be turned on or off. If the role is not set, then the
ActiveModeManager.getRole() will return UNSPECIFIED when scan only mode
is being turned on and hence scanner will not be turned on.
Also,
a) Ensure that we trigger onStarted() callback if we transition
between various connectivity roles (this code path is unused currently
because we don't support STA + STA).
b) Add a new shell command to toggling wifi scan always available
setting.
Bug: 146824945
Test: Manual verification (failing scenario)
a) Reboot device with wifi off & wifi scanning off.
b) Toggle wifi scanning on.
c) Ensure scans work.
Test: atest com.android.server.wifi
Change-Id: I129f7876cd7f34d51a3cb4036de5259875a7cd2e
3 files changed