WifiScanningServiceImpl: Ignore duplicate scan available

Receiving duplicate SCAN_AVAILABLE broadcast currently puts WifiScanner
in a weird state. This is what happens:
a) WifiBackgroundScanStateMachine is already in StartedState.
b) WifiBackgroundScanStateMachine receives another CMD_DRIVER_LOADED
message.
c) CMD_DRIVER_LOADED is handled in the DefaultState which creates a new
mScannerImpl instance.
d) Handling of CMD_DRIVER_LOADED also asks the
WifiBackgroundScanStateMachine to transition to StartedState.
e) This causes WifiBackgroundScanStateMachine to transition out of
StartedState and back into StartedState.
(This transition to the same state should probably have been ignored
by the base StateMachine class)
f) In the above transition, exit() of StartedState invokes
mScannerImpl.cleanup().

So, we end up with a new mScannerImpl instance on which we invoked
mScannerImpl.cleanup() and hence no more scans work.

Note: We may still need to debug why WSM is sending out back to back
scan available notification. But, we should fix the handling in
WifiScanner regardless.

Bug: 78549365
Test: Unit tests
Test: Ran WifiManager ACTS tests locally
Test: Toggled wifi a bunch of times and ensured scanning still works.
Change-Id: I2cf606ecf2d2d261d3354be30135c4ec93f278ff
2 files changed