[DO NOT MERGE] Fix WifiLock CTS test cases

For low latency lock to be active, wifi needs to be connected, screen
should be ON and application should be in foreground. Make sure the
pre-requisites are met before running low latency tests.

Also add a check for wifi is connected before running high perf lock
test.

MUST_SLEEP

Bug: 266749003
Bug: 286810436
Test: atest
CtsStatsdAtomHostTestCases:android.cts.statsdatom.wifi.WifiStatsTests
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3328d093f26f72cfc8768e4aaf8d6ad507ace59a)
Merged-In: I7ba14bb324f19b3be6c6587c938a9543deb87310
Change-Id: I7ba14bb324f19b3be6c6587c938a9543deb87310
3 files changed