Force reconnect in connectToWifi

There is no guarantee that Wifi will automatically reconnect after
enabling, especially in cases where no internet access was detected on
the access point the last time it was connected.

Use WifiManager#reconnect to force wifi to reconnect to the access
point. The API is deprecated for general use, but system apps are
documented as exempted from the deprecation.

Bug: 152280218
Test: atest --rerun-until-failure 200 CtsNetTestCases:CaptivePortalTest
Merged-In: Ia7d83337ee0ffad9414031711cf7e937b14f968d
Change-Id: Ia7d83337ee0ffad9414031711cf7e937b14f968d
1 file changed