Merge "Revert "[Settings] Support getSystemService(Class<T>)"" into sc-dev
This commit is contained in:
@@ -78,7 +78,7 @@ public class NetworkRequestDialogActivityTest {
|
||||
mActivity = spy(activity);
|
||||
|
||||
mWifiManager = mock(WifiManager.class);
|
||||
when(mActivity.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
|
||||
when(mActivity.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -53,7 +53,7 @@ public class WifiEnablerTest {
|
||||
@Before
|
||||
public void setUp() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
|
||||
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
|
||||
mEnabler = new WifiEnabler(mContext, mock(SwitchWidgetController.class),
|
||||
mock(MetricsFeatureProvider.class), mConnectivityManager);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class WifiPrimarySwitchPreferenceControllerTest {
|
||||
when(mContext.getSystemService(NetworkScoreManager.class)).thenReturn(mNetworkScoreManager);
|
||||
mController = new WifiPrimarySwitchPreferenceController(mContext, mMetricsFeatureProvider);
|
||||
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
|
||||
when(mContext.getSystemService(WifiManager.class)).thenReturn(mWifiManager);
|
||||
when(mContext.getSystemService(Context.WIFI_SERVICE)).thenReturn(mWifiManager);
|
||||
when(mWifiManager.getWifiState()).thenReturn(WifiManager.WIFI_STATE_DISABLED);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public class DisclaimerItemListAdapterTest {
|
||||
|
||||
when(mLayoutInflater.inflate(anyInt(), anyObject(), anyBoolean())).thenReturn(mView);
|
||||
when(mViewGroup.getContext()).thenReturn(mContext);
|
||||
when(mViewGroup.getContext().getSystemService(LayoutInflater.class)).thenReturn(
|
||||
when(mViewGroup.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).thenReturn(
|
||||
mLayoutInflater);
|
||||
when(mView.findViewById(ID_DISCLAIMER_ITEM_TITLE)).thenReturn(mTestView);
|
||||
when(mView.findViewById(ID_DISCLAIMER_ITEM_DESCRIPTION)).thenReturn(mDescView);
|
||||
|
||||
@@ -54,7 +54,7 @@ public class EmergencyCallLimitationDisclaimerTest {
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
|
||||
doReturn(mCarrierConfigManager).when(mContext).getSystemService(
|
||||
CarrierConfigManager.class);
|
||||
Context.CARRIER_CONFIG_SERVICE);
|
||||
when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(mBundle);
|
||||
|
||||
doReturn(getSharedPreferences()).when(mContext).getSharedPreferences(anyString(), anyInt());
|
||||
|
||||
@@ -54,7 +54,7 @@ public class LocationPolicyDisclaimerTest {
|
||||
mContext = spy(RuntimeEnvironment.application);
|
||||
|
||||
doReturn(mCarrierConfigManager).when(mContext).getSystemService(
|
||||
CarrierConfigManager.class);
|
||||
Context.CARRIER_CONFIG_SERVICE);
|
||||
when(mCarrierConfigManager.getConfigForSubId(anyInt())).thenReturn(mBundle);
|
||||
doReturn(getSharedPreferences()).when(mContext).getSharedPreferences(anyString(), anyInt());
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user