Revert "[Settings] Convert to getSystemService(Class<T>)"

Revert submission 1645152-getSystemService(Class<T>)

Reason for revert: Fix JUnit test failure
Reverted Changes:
I1b4812044:[Settings] Convert to getSystemService(Class<T>)
I278951c24:[Settings] Support getSystemService(Class<T>)

Change-Id: I864a40f82ba9cb4170900ac0c1d77f781b17341f
This commit is contained in:
Bonian Chen
2021-03-31 09:37:03 +00:00
parent 13fb77c652
commit d6f54ed90b
64 changed files with 103 additions and 103 deletions

View File

@@ -94,7 +94,7 @@ public class EnabledNetworkModePreferenceControllerTest {
when(mContext.getSystemService(CarrierConfigManager.class)).thenReturn(
mCarrierConfigManager);
when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);
doReturn(mInvalidTelephonyManager).when(mTelephonyManager).createForSubscriptionId(

View File

@@ -73,7 +73,7 @@ public class MobileDataPreferenceControllerTest {
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
doReturn(mTelephonyManager).when(mContext).getSystemService(TelephonyManager.class);
doReturn(mTelephonyManager).when(mContext).getSystemService(Context.TELEPHONY_SERVICE);
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
doReturn(mTelephonyManager).when(mTelephonyManager).createForSubscriptionId(SUB_ID);