diff options
author | Justin Klaassen <justinklaassen@google.com> | 2017-10-10 15:20:13 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2017-10-10 15:20:13 -0400 |
commit | 93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6 (patch) | |
tree | 49f76f879a89c256a4f65b674086be50760bdffb /android/telephony/TelephonyManager.java | |
parent | bc81c7ada5aab3806dd0b17498f5c9672c9b33c4 (diff) | |
download | android-28-93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6.tar.gz |
Import Android SDK Platform P [4386628]
/google/data/ro/projects/android/fetch_artifact \
--bid 4386628 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4386628.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: I9b8400ac92116cae4f033d173f7a5682b26ccba9
Diffstat (limited to 'android/telephony/TelephonyManager.java')
-rw-r--r-- | android/telephony/TelephonyManager.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/android/telephony/TelephonyManager.java b/android/telephony/TelephonyManager.java index cde0bdfd..c0564c55 100644 --- a/android/telephony/TelephonyManager.java +++ b/android/telephony/TelephonyManager.java @@ -107,8 +107,6 @@ public class TelephonyManager { public static final String MODEM_ACTIVITY_RESULT_KEY = BatteryStats.RESULT_RECEIVER_CONTROLLER_KEY; - private static ITelephonyRegistry sRegistry; - /** * The allowed states of Wi-Fi calling. * @@ -179,11 +177,6 @@ public class TelephonyManager { mContext = context; } mSubscriptionManager = SubscriptionManager.from(mContext); - - if (sRegistry == null) { - sRegistry = ITelephonyRegistry.Stub.asInterface(ServiceManager.getService( - "telephony.registry")); - } } /** @hide */ @@ -3513,6 +3506,10 @@ public class TelephonyManager { return ITelecomService.Stub.asInterface(ServiceManager.getService(Context.TELECOM_SERVICE)); } + private ITelephonyRegistry getTelephonyRegistry() { + return ITelephonyRegistry.Stub.asInterface(ServiceManager.getService("telephony.registry")); + } + // // // PhoneStateListener @@ -3552,12 +3549,16 @@ public class TelephonyManager { if (listener.mSubId == null) { listener.mSubId = mSubId; } - sRegistry.listenForSubscriber(listener.mSubId, getOpPackageName(), - listener.callback, events, notifyNow); + + ITelephonyRegistry registry = getTelephonyRegistry(); + if (registry != null) { + registry.listenForSubscriber(listener.mSubId, getOpPackageName(), + listener.callback, events, notifyNow); + } else { + Rlog.w(TAG, "telephony registry not ready."); + } } catch (RemoteException ex) { // system process dead - } catch (NullPointerException ex) { - // system process dead } } |