Remove flakiness by ensuring active network connection
DownloadManager tests assumes that the device has an active internet
connection, it can be flaky if some other test turns off wifi or data
connection. Turn on wifi and connect to a network if no active network
connection is found on the test device.
Test: Turn off wifi, atest CtsDownloadManagerApi28 --iteration 20
Test: Turn off wifi, atest CtsDownloadManagerInstaller --iterations 20
Test: Turn off wifi, atest DownloadManagerTest
Bug: 159301651
Bug: 180519943
Change-Id: I43894a22f38542ab743d0200bb0bde64df02c85e
(cherry picked from commit cc9c4ea4238da83fca82955acd8a1dfed4706fc5)
Merged-In: I43894a22f38542ab743d0200bb0bde64df02c85e
4 files changed