diff --git a/api/current.txt b/api/current.txt index b754dbc5f929c..79a5c3f247547 100644 --- a/api/current.txt +++ b/api/current.txt @@ -44936,7 +44936,7 @@ package android.telephony { method public String getNetworkOperator(); method public String getNetworkOperatorName(); method public String getNetworkSpecifier(); - method public int getNetworkType(); + method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getNetworkType(); method public int getPhoneCount(); method public int getPhoneType(); method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index cd135668df099..537e266af56fd 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2512,8 +2512,13 @@ public class TelephonyManager { public @interface NetworkType{} /** + * Return the current data network type. + * + * @deprecated use {@link #getDataNetworkType()} * @return the NETWORK_TYPE_xxxx for current data connection. */ + @Deprecated + @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public @NetworkType int getNetworkType() { return getNetworkType(getSubId(SubscriptionManager.getDefaultDataSubscriptionId())); }