ConcreteClientModeManager: Invoke onStopped() from IdleState exit

Needed to handle stop() call before we have moved to StartedState.

Also,
i) Change the state heirarchy for both ClientModeManager & SoftApManager
to ensure that IdleState is the parent state for all sub-states (helps
put the onStopped() in one central place).
ii) Exit the state machine directly when an interface down/destroyed
callback is received. The current transition to "IdleState" is useless
since the exit of "StartedState" already triggers a state machine exit.
This also causes some weird state transitions currently (Started ->
quitNow() -> Idle -> quit())

Bug: 174119612
Test: atest com.android.server.wifi (Added a test which was failing
before making the changes). All other unit tests passes.

Change-Id: Ib8c15cee44f4dc71df6709274097f7fb1ef2a70f
3 files changed
tree: e2243b4d4e413b676b05e8d926021d9c838b045d
  1. apex/
  2. service/
  3. metrics_pdd_hook.py
  4. PREUPLOAD.cfg