diff options
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | api/system-current.txt | 5 | ||||
| -rw-r--r-- | api/test-current.txt | 2 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 31 |
4 files changed, 30 insertions, 10 deletions
diff --git a/api/current.txt b/api/current.txt index 77cb9e490b04..d243652e56a9 100644 --- a/api/current.txt +++ b/api/current.txt @@ -39812,7 +39812,6 @@ package android.telephony { method public android.os.PersistableBundle getCarrierConfig(); method public android.telephony.CellLocation getCellLocation(); method public int getDataActivity(); - method public boolean getDataEnabled(); method public int getDataNetworkType(); method public int getDataState(); method public java.lang.String getDeviceId(); @@ -39853,6 +39852,7 @@ package android.telephony { method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public boolean isConcurrentVoiceAndDataAllowed(); + method public boolean isDataEnabled(); method public boolean isHearingAidCompatibilitySupported(); method public boolean isNetworkRoaming(); method public boolean isSmsCapable(); diff --git a/api/system-current.txt b/api/system-current.txt index 827b46ce7746..97048c65a3ae 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -43216,8 +43216,8 @@ package android.telephony { method public int getCurrentPhoneType(); method public int getCurrentPhoneType(int); method public int getDataActivity(); - method public boolean getDataEnabled(); - method public boolean getDataEnabled(int); + method public deprecated boolean getDataEnabled(); + method public deprecated boolean getDataEnabled(int); method public int getDataNetworkType(); method public int getDataState(); method public java.lang.String getDeviceId(); @@ -43264,6 +43264,7 @@ package android.telephony { method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public boolean isConcurrentVoiceAndDataAllowed(); method public boolean isDataConnectivityPossible(); + method public boolean isDataEnabled(); method public boolean isHearingAidCompatibilitySupported(); method public boolean isIdle(); method public boolean isNetworkRoaming(); diff --git a/api/test-current.txt b/api/test-current.txt index 04f4f21e095f..848b5044062d 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -40001,7 +40001,6 @@ package android.telephony { method public android.os.PersistableBundle getCarrierConfig(); method public android.telephony.CellLocation getCellLocation(); method public int getDataActivity(); - method public boolean getDataEnabled(); method public int getDataNetworkType(); method public int getDataState(); method public java.lang.String getDeviceId(); @@ -40042,6 +40041,7 @@ package android.telephony { method public java.lang.String iccTransmitApduBasicChannel(int, int, int, int, int, java.lang.String); method public java.lang.String iccTransmitApduLogicalChannel(int, int, int, int, int, int, java.lang.String); method public boolean isConcurrentVoiceAndDataAllowed(); + method public boolean isDataEnabled(); method public boolean isHearingAidCompatibilitySupported(); method public boolean isNetworkRoaming(); method public boolean isSmsCapable(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 51b91f4c7999..786252318023 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5276,23 +5276,42 @@ public class TelephonyManager { } } + + /** + * @deprecated use {@link #isDataEnabled()} instead. + * @hide + */ + @SystemApi + @Deprecated + public boolean getDataEnabled() { + return isDataEnabled(); + } + /** * Returns whether mobile data is enabled or not. * - * <p>Requires Permission: - * {@link android.Manifest.permission#ACCESS_NETWORK_STATE ACCESS_NETWORK_STATE}, - * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}, or that the - * calling app has carrier privileges. + * <p>Requires one of the following permissions: + * {@link android.Manifest.permission#ACCESS_NETWORK_STATE ACCESS_NETWORK_STATE}, + * {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}, or that the + * calling app has carrier privileges. + * + * <p>Note that this does not take into account any data restrictions that may be present on the + * calling app. Such restrictions may be inspected with + * {@link ConnectivityManager#getRestrictBackgroundStatus}. * * @return true if mobile data is enabled. * * @see #hasCarrierPrivileges */ - public boolean getDataEnabled() { + @SuppressWarnings("deprecation") + public boolean isDataEnabled() { return getDataEnabled(getSubId()); } - /** @hide */ + /** + * @deprecated use {@link #isDataEnabled(int)} instead. + * @hide + */ @SystemApi public boolean getDataEnabled(int subId) { boolean retVal = false; |