Merge "Remove usage of Telephonymanager from() hidden API"
am: 8e999f22b8
Change-Id: Icee4117f892b09ce3eafeb39668467cc2220f31b
This commit is contained in:
committed by
android-build-merger
commit
fc8b731e33
@@ -222,7 +222,8 @@ public class DataUsageController {
|
||||
}
|
||||
}
|
||||
|
||||
return TelephonyManager.from(mContext).createForSubscriptionId(subscriptionId);
|
||||
return mContext.getSystemService(
|
||||
TelephonyManager.class).createForSubscriptionId(subscriptionId);
|
||||
}
|
||||
|
||||
public void setMobileDataEnabled(boolean enabled) {
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DataUsageControllerTest {
|
||||
public void setUp() throws RemoteException {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
|
||||
when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
|
||||
when(mContext.getSystemService(TelephonyManager.class)).thenReturn(mTelephonyManager);
|
||||
when(mContext.getSystemService(Context.TELEPHONY_SUBSCRIPTION_SERVICE))
|
||||
.thenReturn(mSubscriptionManager);
|
||||
when(mContext.getSystemService(NetworkStatsManager.class)).thenReturn(mNetworkStatsManager);
|
||||
|
||||
Reference in New Issue
Block a user