From 41f6ab87c38a8b1133f494cd92f405e683f34ae4 Mon Sep 17 00:00:00 2001 From: Daniel Bright Date: Thu, 27 Feb 2020 17:40:38 -0800 Subject: [PATCH] Make isDataCapable a public API This is part of the larger network attributes change Bug: 147342211 Bug: 146206136 Test: make Merged-In: I4f5dd3440e403b96112bf2e848bffb5aac299732 Change-Id: I2e1c22c78cd48e04ecd045d095dee70deeebebc9 --- api/current.txt | 1 + .../java/android/telephony/TelephonyManager.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index 4118bcc6baf87..a9b9f2dc2f933 100644 --- a/api/current.txt +++ b/api/current.txt @@ -45955,6 +45955,7 @@ package android.telephony { method @Deprecated public String iccTransmitApduBasicChannel(int, int, int, int, int, String); method @Deprecated public String iccTransmitApduLogicalChannel(int, int, int, int, int, int, String); method public boolean isConcurrentVoiceAndDataSupported(); + method public boolean isDataCapable(); method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean isDataEnabled(); method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isDataRoamingEnabled(); method public boolean isEmergencyNumber(@NonNull String); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 76b914555f896..d5c889f7c4a2e 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -11029,9 +11029,15 @@ public class TelephonyManager { } /** - * Checks if FEATURE_TELEPHONY_DATA is enabled. - * - * @hide + * @return true if the current device is "data capable" over a radio on the device. + *

+ * "Data capable" means that this device supports packet-switched + * data connections over the telephony network. + *

+ * Note: the meaning of this flag is subtly different from the + * PackageManager.FEATURE_TELEPHONY system feature, which is available + * on any device with a telephony radio, even if the device is + * voice-only. */ public boolean isDataCapable() { if (mContext == null) return true;