From f0a61676ef810797849e1234854becc7647452b5 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Mon, 26 Oct 2020 13:21:11 -0700 Subject: [PATCH] Update docs for TelephonyManager#getServiceState Add a link to the alternative way of obtaining service state through PhoneStateListener Fixes: 171704709 Test: docs only Change-Id: Iee5d8a68b93ecc4029ae21ccac52dc93d56dc253 --- telephony/java/android/telephony/TelephonyManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index ca47b83b20e70..e33569919e368 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -10319,6 +10319,9 @@ public class TelephonyManager { *

If this object has been created with {@link #createForSubscriptionId}, applies to the * given subId. Otherwise, applies to {@link SubscriptionManager#getDefaultSubscriptionId()} * + * If you want continuous updates of service state info, register a {@link PhoneStateListener} + * via {@link #listen} with the {@link PhoneStateListener#LISTEN_SERVICE_STATE} event. + * *

Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}) * and {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}.