WifiNetworkFactory: Move CMM retrieval later in connection processing

WifiNetworkFactory currently requests for a new CMM from
ActiveModeWarden upfront when a new connection request comes in.
However, if the primary CMM is already connected to the same BSSID as
the new connection request, we should not use a second STA (since that
will cause us to have 2 concurrent connections to the same BSSID). So,
refactor the API processing to ensure that we request the new CMM only
after we finish scanning, finding the best bssid, etc. A follow up CL
will add the logic to ensure that we fallback to single STA behavior if
the requesed bssid is the same as the bssid that is active on the
primary CMM.

Also,
i) Add a method in ActiveModeWarden to check if wifi is on.
ii) Remove log for CMM iface name after retrieval (CMM's have a toString() now
which logs relevant info)

Bug: 148935691
Test: atest com.android.server.wifi
Test: adb shell cmd wifi add-request <SSID> open
Change-Id: I2ccb32d171aa5017e922b1f6b658131ce9c104df
3 files changed
tree: 64b0330d3886e39f4564ea765b315b0ed3ebedb9
  1. apex/
  2. service/
  3. metrics_pdd_hook.py
  4. PREUPLOAD.cfg