Fix ConnectivityManagerApi23Test failures and remove duplication.

1. All ConnectivityManagerApi23Test were failed due to
   WifiManager#setWifiEnabled doesn't allow to use since
   Android Q. So we need to use shell command to enable/disable
   Wi-Fi instead.
2. Some methods are duplicated between
   ConnectivityManagerApi23Test and ConnectivityManagerTest, but
   they are not identical. So put these methods into
   ConnectivityUtils to clean up duplications and prevent fork
   happened again.

Bug: 133334943
Bug: 133209319
Test: Run the below tests on Crosshatch, Sailfish, Bonito.
      atest CtsNetApi23TestCases
      atest CtsNetTestCases

Change-Id: Ic37111cb12a46f5c36c2be887250c5d762216f6e
Merged-In: I075b7408d2a1e1145c7a9031075e07fa1db37fed
Merged-In: I0c02357eff07b98c1745de35d08ae6b8349de7fb
Merged-In: I04d1e1d096bcd4a9626cf9f00396fca7f9892a82
6 files changed
tree: eaef4b8fc088f0cde9fb1e39a23eb506d30754be
  1. tests/