Merge "Revert "[Settings] Support getSystemService(Class<T>)"" into sc-dev

This commit is contained in:
Bonian Chen
2021-03-30 05:31:52 +00:00
committed by Android (Google) Code Review
62 changed files with 100 additions and 100 deletions

View File

@@ -73,8 +73,8 @@ public class WifiTetherApBandPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
mPreference = new ListPreference(RuntimeEnvironment.application);
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
when(mContext.getSystemService(TetheringManager.class)).thenReturn(mTetheringManager);
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
when(mContext.getSystemService(Context.TETHERING_SERVICE)).thenReturn(mTetheringManager);
when(mTetheringManager.getTetherableWifiRegexs()).thenReturn(new String[]{"1", "2"});
when(mContext.getResources()).thenReturn(RuntimeEnvironment.application.getResources());
when(mScreen.findPreference(anyString())).thenReturn(mPreference);

View File

@@ -80,8 +80,8 @@ public class WifiTetherSettingsTest {
MockitoAnnotations.initMocks(this);
doReturn(mConnectivityManager)
.when(mContext).getSystemService(ConnectivityManager.class);
doReturn(mTetheringManager).when(mContext).getSystemService(TetheringManager.class);
.when(mContext).getSystemService(Context.CONNECTIVITY_SERVICE);
doReturn(mTetheringManager).when(mContext).getSystemService(Context.TETHERING_SERVICE);
doReturn(WIFI_REGEXS).when(mTetheringManager).getTetherableWifiRegexs();
doReturn(mUserManager).when(mContext).getSystemService(Context.USER_SERVICE);