From 5415922f32ea24ac42b38dd3f7a7c139279e4d71 Mon Sep 17 00:00:00 2001 From: Lee Chou Date: Fri, 10 Jan 2020 17:14:08 +0800 Subject: [PATCH] Removed reference to TelephonyManager#from Bug: 147469171 Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=MmsMessagePreferenceControllerTest Change-Id: Icfbcd948cd5072bd2e44942bff79562f540ab2b4 --- .../network/telephony/MmsMessagePreferenceController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/network/telephony/MmsMessagePreferenceController.java b/src/com/android/settings/network/telephony/MmsMessagePreferenceController.java index b428b2215a6..07b808fc445 100644 --- a/src/com/android/settings/network/telephony/MmsMessagePreferenceController.java +++ b/src/com/android/settings/network/telephony/MmsMessagePreferenceController.java @@ -50,8 +50,8 @@ public class MmsMessagePreferenceController extends TelephonyTogglePreferenceCon @Override public int getAvailabilityStatus(int subId) { - final TelephonyManager telephonyManager = TelephonyManager - .from(mContext).createForSubscriptionId(subId); + final TelephonyManager telephonyManager = mContext.getSystemService(TelephonyManager.class) + .createForSubscriptionId(subId); return (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID && !telephonyManager.isDataEnabled() && telephonyManager.isApnMetered(ApnSetting.TYPE_MMS))