WifiNetworkFactory: Cache CMM role on creation
Role of ClientModeManager after stopping would return null. Cache the
role of the CMM retrieved immediately on creation to ensure that we
turn auto-join back on after wifi off.
Also, added a helper method for removing CMM (which is duplicated couple
of times).
Bug: 178749452
Test: atest WifiNetworkFactoryTest
Test: Manual steps:
- Ensure auto-join is enabled.
- Trigger connection using networkrequest/specifier.
- Ensure auto-join is disabled.
- Toggle wifi off.
- Toggle wifi on.
- Ensure auto-join is enabled.
Change-Id: I6d8cdea16b7d5546d8c9a10ba4a9d01da8e97bb6
2 files changed