Try reconnecting to wifi if it doesn't automatically connect.

When meteredness of wifi changes during test, wifi disconnects.
Try reconnecting if it automatically connects after this.
Also, change the way we update metereness so that we can
use callback mechanism to wait for the state change instead of
polling for it regularly.

Bug: 181686645
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Submitting internally first to avoid merge conflicts
Change-Id: I31fb127ef333d39fe4697043876c7cef15d525e3
1 file changed
tree: 8901b2fae8318cd829a7f9078d195155adc30ec4
  1. tests/
  2. Tethering/
  3. .gitignore
  4. OWNERS
  5. PREUPLOAD.cfg
  6. TEST_MAPPING