ConcreteClientModeManager: Set role on entering ConnectModeState

Currently we don't set the role on entering the ConnectModeState (we do
that for ScanOnlyModeState) because we have many connectivity roles and
we don't have an inherent mechanism in StateMachine to send an arg
when making a state transition. Setting the role and invoking the
onStart/onRoleChanged callback before everything is setup (which is what
we do today to workaround the issue) is potentially racy (since other
modules assume that the mode manager is ready to use when they get the
callbacks from ActiveModeWarden.
Workaround this limitation by using a member variable to pass the role
to use when transitioning to the ConnectModeState.

Bug: 169878126
Test: atest com.android.server.wifi
Test: Manual steps:
Create second STA using peer to peer API (on a STA + STA enabled
device) multiple times (had previously noticed this fail intermittently)

Change-Id: I7e51ad61e477cf75166f1de0b582b9822c5bcebb
1 file changed
tree: 33e24b22bc85254e9124845152af63ec1828a548
  1. apex/
  2. service/
  3. metrics_pdd_hook.py
  4. PREUPLOAD.cfg