ActiveModeWarden: Don't allow STA + STA for older apps

To avoid backwards compatibility issues, ensure that we don't trigger
the STA + STA flow for non-system apps that target older SDK versions.

Note: This app SDK version check is intentionally put in ActiveModeWarden
to avoid more code-paths in WifiNetworkFactory(we could have
alternatively made WifiNetworkFactory request a primary CMM when it
detects older apps, but that would then create an alternate synchronous
code path in WifiNetworkFactory for post CMM retrieval processing)
Also, putting all STA + STA related checks in one central place make
code more managaeable.

Note: The previous backward compat behavior added for
WifiManager#getConnectionInfo(), etc is still retained since
WifiManager#getConnectionInfo() is not STA + STA capable, so if someone
is using that API when STA + STA is active, we try our best to guess the
WifiInfo they are looking for.

Bug: 183709867
Test: atest com.android.server.wifi
Change-Id: I49a8d35be1dd38470c74539964dbceba6ed32c20
3 files changed