Fix the WifiTether test case failed

- Use the same service name(WifiManager.class) to mock
WifiManager.class

- Use the same service name(TetheringManager.class) to mock
TetheringManager.class

Bug: 184018452
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTether

Change-Id: I64741818d3455154866097f83e3a96c1c510e23b
This commit is contained in:
Weng Su
2021-03-30 17:13:58 +08:00
parent 4559d22e51
commit b63e672fa8

View File

@@ -45,8 +45,8 @@ public abstract class WifiTetherBasePreferenceController extends AbstractPrefere
OnTetherConfigUpdateListener listener) {
super(context);
mListener = listener;
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
mTm = (TetheringManager) context.getSystemService(Context.TETHERING_SERVICE);
mWifiManager = context.getSystemService(WifiManager.class);
mTm = context.getSystemService(TetheringManager.class);
mWifiRegexs = mTm.getTetherableWifiRegexs();
}