Fix race condition causing occasional CTS failures.

WifiManagerTest was waiting for SUPPLICANT_STATE_CHANGED_ACTION
after enabling or disabling WiFi. Fix the code to check if the
WiFi state is already the desired state, and if not, to wait for
the WIFI_STATE_CHANGED_ACTION broadcast intent.

Bug: 7082455
Change-Id: Id1c2242c32311084f5587ea5403f6b227d1b8b04
1 file changed