commit | 8b416f029c2faaa5b0c684047c2ed32c5492a392 | [log] [tgz] |
---|---|---|
author | Android Build Merger (Role) <noreply-android-build-merger@google.com> | Mon Nov 18 19:02:20 2019 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Mon Nov 18 19:02:20 2019 +0000 |
tree | 6579d95968affeb74719003f039ba8d7bb701f6e | |
parent | 82865f85c1fc2367165d390ac69e554b494583f6 [diff] | |
parent | ef5ac8fb555a9571922db2c3790fde769331fbde [diff] |
Merge "Merge "Remove usage of Telephonymanager from() hidden API" am: 8e999f22b8 am: fc8b731e33 am: 4931429f5a"
diff --git a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java index ea3c1d9..092cbf3 100644 --- a/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java +++ b/packages/SettingsLib/src/com/android/settingslib/net/DataUsageController.java
@@ -222,7 +222,8 @@ } } - return TelephonyManager.from(mContext).createForSubscriptionId(subscriptionId); + return mContext.getSystemService( + TelephonyManager.class).createForSubscriptionId(subscriptionId); } public void setMobileDataEnabled(boolean enabled) {
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/DataUsageControllerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/DataUsageControllerTest.java index 3da5e76..f7bee30 100644 --- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/DataUsageControllerTest.java +++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/DataUsageControllerTest.java
@@ -75,7 +75,7 @@ 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);