Make isDataCapable a public API

There is no definitive API to determine whether a device supports mobile
data; this API fills the gap.

Bug: 146206136
Test: m
Change-Id: I5daa302063ee4e9c27dd9ba1a09d65af80ed9d99
This commit is contained in:
Remi NGUYEN VAN
2021-03-12 19:08:02 +09:00
parent c4b72cd7ef
commit a3648a387c
2 changed files with 1 additions and 6 deletions

View File

@@ -41024,6 +41024,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.READ_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public boolean isDataConnectionAllowed();
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isDataEnabled();
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isDataEnabledForReason(int);

View File

@@ -11859,12 +11859,6 @@ public class TelephonyManager {
* "Data capable" means that this device supports packet-switched
* data connections over the telephony network.
* <p>
* 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.
*
* @hide
*/
public boolean isDataCapable() {
if (mContext == null) return true;