Add missing @Deprecated annotations.

Add missing @Deprecated annotations for methods with @deprecated tag
in javadoc.

Change-Id: I35b78ccb97832d86b914c21a300444ba29e33844
This commit is contained in:
Aurimas Liutikas
2016-05-24 15:22:55 -07:00
parent 6836591712
commit e80a0eb435
2 changed files with 23 additions and 0 deletions

View File

@@ -435,6 +435,7 @@ public class ConnectivityManager {
* {@link #requestNetwork(NetworkRequest, NetworkCallback)} to request a network that * {@link #requestNetwork(NetworkRequest, NetworkCallback)} to request a network that
* provides the {@link NetworkCapabilities#NET_CAPABILITY_MMS} capability. * provides the {@link NetworkCapabilities#NET_CAPABILITY_MMS} capability.
*/ */
@Deprecated
public static final int TYPE_MOBILE_MMS = 2; public static final int TYPE_MOBILE_MMS = 2;
/** /**
* A SUPL-specific Mobile data connection. This network type may use the * A SUPL-specific Mobile data connection. This network type may use the
@@ -446,6 +447,7 @@ public class ConnectivityManager {
* {@link #requestNetwork(NetworkRequest, NetworkCallback)} to request a network that * {@link #requestNetwork(NetworkRequest, NetworkCallback)} to request a network that
* provides the {@link NetworkCapabilities#NET_CAPABILITY_SUPL} capability. * provides the {@link NetworkCapabilities#NET_CAPABILITY_SUPL} capability.
*/ */
@Deprecated
public static final int TYPE_MOBILE_SUPL = 3; public static final int TYPE_MOBILE_SUPL = 3;
/** /**
* A DUN-specific Mobile data connection. This network type may use the * A DUN-specific Mobile data connection. This network type may use the
@@ -463,6 +465,7 @@ public class ConnectivityManager {
* {@link #requestNetwork(NetworkRequest, NetworkCallback)} to request a network that * {@link #requestNetwork(NetworkRequest, NetworkCallback)} to request a network that
* uses the {@link NetworkCapabilities#TRANSPORT_CELLULAR} transport. * uses the {@link NetworkCapabilities#TRANSPORT_CELLULAR} transport.
*/ */
@Deprecated
public static final int TYPE_MOBILE_HIPRI = 5; public static final int TYPE_MOBILE_HIPRI = 5;
/** /**
* The WiMAX data connection. When active, all data traffic * The WiMAX data connection. When active, all data traffic
@@ -593,6 +596,7 @@ public class ConnectivityManager {
* @deprecated All APIs accepting a network type are deprecated. There should be no need to * @deprecated All APIs accepting a network type are deprecated. There should be no need to
* validate a network type. * validate a network type.
*/ */
@Deprecated
public static boolean isNetworkTypeValid(int networkType) { public static boolean isNetworkTypeValid(int networkType) {
return networkType >= 0 && networkType <= MAX_NETWORK_TYPE; return networkType >= 0 && networkType <= MAX_NETWORK_TYPE;
} }
@@ -700,6 +704,7 @@ public class ConnectivityManager {
* preference. Instead we use dynamic network properties of * preference. Instead we use dynamic network properties of
* the networks to describe their precedence. * the networks to describe their precedence.
*/ */
@Deprecated
public void setNetworkPreference(int preference) { public void setNetworkPreference(int preference) {
} }
@@ -715,6 +720,7 @@ public class ConnectivityManager {
* preference. Instead we use dynamic network properties of * preference. Instead we use dynamic network properties of
* the networks to describe their precedence. * the networks to describe their precedence.
*/ */
@Deprecated
public int getNetworkPreference() { public int getNetworkPreference() {
return TYPE_NONE; return TYPE_NONE;
} }
@@ -871,6 +877,7 @@ public class ConnectivityManager {
* of the same type. Use {@link #getAllNetworks} and * of the same type. Use {@link #getAllNetworks} and
* {@link #getNetworkInfo(android.net.Network)} instead. * {@link #getNetworkInfo(android.net.Network)} instead.
*/ */
@Deprecated
public NetworkInfo getNetworkInfo(int networkType) { public NetworkInfo getNetworkInfo(int networkType) {
try { try {
return mService.getNetworkInfo(networkType); return mService.getNetworkInfo(networkType);
@@ -917,6 +924,7 @@ public class ConnectivityManager {
* of the same type. Use {@link #getAllNetworks} and * of the same type. Use {@link #getAllNetworks} and
* {@link #getNetworkInfo(android.net.Network)} instead. * {@link #getNetworkInfo(android.net.Network)} instead.
*/ */
@Deprecated
public NetworkInfo[] getAllNetworkInfo() { public NetworkInfo[] getAllNetworkInfo() {
try { try {
return mService.getAllNetworkInfo(); return mService.getAllNetworkInfo();
@@ -937,6 +945,7 @@ public class ConnectivityManager {
* of the same type. Use {@link #getAllNetworks} and * of the same type. Use {@link #getAllNetworks} and
* {@link #getNetworkInfo(android.net.Network)} instead. * {@link #getNetworkInfo(android.net.Network)} instead.
*/ */
@Deprecated
public Network getNetworkForType(int networkType) { public Network getNetworkForType(int networkType) {
try { try {
return mService.getNetworkForType(networkType); return mService.getNetworkForType(networkType);
@@ -1009,6 +1018,7 @@ public class ConnectivityManager {
* {@link #getNetworkInfo(android.net.Network)}, and * {@link #getNetworkInfo(android.net.Network)}, and
* {@link #getLinkProperties(android.net.Network)} instead. * {@link #getLinkProperties(android.net.Network)} instead.
*/ */
@Deprecated
public LinkProperties getLinkProperties(int networkType) { public LinkProperties getLinkProperties(int networkType) {
try { try {
return mService.getLinkPropertiesForType(networkType); return mService.getLinkPropertiesForType(networkType);
@@ -1091,6 +1101,7 @@ public class ConnectivityManager {
* In {@link VERSION_CODES#M}, and above, this method is unsupported and will * In {@link VERSION_CODES#M}, and above, this method is unsupported and will
* throw {@code UnsupportedOperationException} if called. * throw {@code UnsupportedOperationException} if called.
*/ */
@Deprecated
public int startUsingNetworkFeature(int networkType, String feature) { public int startUsingNetworkFeature(int networkType, String feature) {
checkLegacyRoutingApiAccess(); checkLegacyRoutingApiAccess();
NetworkCapabilities netCap = networkCapabilitiesForFeature(networkType, feature); NetworkCapabilities netCap = networkCapabilitiesForFeature(networkType, feature);
@@ -1146,6 +1157,7 @@ public class ConnectivityManager {
* In {@link VERSION_CODES#M}, and above, this method is unsupported and will * In {@link VERSION_CODES#M}, and above, this method is unsupported and will
* throw {@code UnsupportedOperationException} if called. * throw {@code UnsupportedOperationException} if called.
*/ */
@Deprecated
public int stopUsingNetworkFeature(int networkType, String feature) { public int stopUsingNetworkFeature(int networkType, String feature) {
checkLegacyRoutingApiAccess(); checkLegacyRoutingApiAccess();
NetworkCapabilities netCap = networkCapabilitiesForFeature(networkType, feature); NetworkCapabilities netCap = networkCapabilitiesForFeature(networkType, feature);
@@ -1559,6 +1571,7 @@ public class ConnectivityManager {
* In {@link VERSION_CODES#M}, and above, this method is unsupported and will * In {@link VERSION_CODES#M}, and above, this method is unsupported and will
* throw {@code UnsupportedOperationException} if called. * throw {@code UnsupportedOperationException} if called.
*/ */
@Deprecated
public boolean requestRouteToHost(int networkType, int hostAddress) { public boolean requestRouteToHost(int networkType, int hostAddress) {
return requestRouteToHostAddress(networkType, NetworkUtils.intToInetAddress(hostAddress)); return requestRouteToHostAddress(networkType, NetworkUtils.intToInetAddress(hostAddress));
} }
@@ -1581,6 +1594,7 @@ public class ConnectivityManager {
* @deprecated Deprecated in favor of the {@link #requestNetwork} and * @deprecated Deprecated in favor of the {@link #requestNetwork} and
* {@link #bindProcessToNetwork} API. * {@link #bindProcessToNetwork} API.
*/ */
@Deprecated
public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) { public boolean requestRouteToHostAddress(int networkType, InetAddress hostAddress) {
checkLegacyRoutingApiAccess(); checkLegacyRoutingApiAccess();
try { try {
@@ -1650,6 +1664,7 @@ public class ConnectivityManager {
* @hide * @hide
* @deprecated Talk to TelephonyManager directly * @deprecated Talk to TelephonyManager directly
*/ */
@Deprecated
public boolean getMobileDataEnabled() { public boolean getMobileDataEnabled() {
IBinder b = ServiceManager.getService(Context.TELEPHONY_SERVICE); IBinder b = ServiceManager.getService(Context.TELEPHONY_SERVICE);
if (b != null) { if (b != null) {
@@ -1803,6 +1818,7 @@ public class ConnectivityManager {
* situations where a Context pointer is unavailable. * situations where a Context pointer is unavailable.
* @hide * @hide
*/ */
@Deprecated
static ConnectivityManager getInstanceOrNull() { static ConnectivityManager getInstanceOrNull() {
return sInstance; return sInstance;
} }
@@ -1812,6 +1828,7 @@ public class ConnectivityManager {
* situations where a Context pointer is unavailable. * situations where a Context pointer is unavailable.
* @hide * @hide
*/ */
@Deprecated
private static ConnectivityManager getInstance() { private static ConnectivityManager getInstance() {
if (getInstanceOrNull() == null) { if (getInstanceOrNull() == null) {
throw new IllegalStateException("No ConnectivityManager yet constructed"); throw new IllegalStateException("No ConnectivityManager yet constructed");
@@ -2219,6 +2236,7 @@ public class ConnectivityManager {
* @deprecated Use {@link #reportNetworkConnectivity} which allows reporting both * @deprecated Use {@link #reportNetworkConnectivity} which allows reporting both
* working and non-working connectivity. * working and non-working connectivity.
*/ */
@Deprecated
public void reportBadNetwork(Network network) { public void reportBadNetwork(Network network) {
try { try {
// One of these will be ignored because it matches system's current state. // One of these will be ignored because it matches system's current state.
@@ -2421,6 +2439,7 @@ public class ConnectivityManager {
* {@hide} * {@hide}
* @deprecated Doesn't properly deal with multiple connected networks of the same type. * @deprecated Doesn't properly deal with multiple connected networks of the same type.
*/ */
@Deprecated
public void setProvisioningNotificationVisible(boolean visible, int networkType, public void setProvisioningNotificationVisible(boolean visible, int networkType,
String action) { String action) {
try { try {
@@ -3211,6 +3230,7 @@ public class ConnectivityManager {
* {@link #bindProcessToNetwork} instead. {@code bindProcessToNetwork} * {@link #bindProcessToNetwork} instead. {@code bindProcessToNetwork}
* is a direct replacement. * is a direct replacement.
*/ */
@Deprecated
public static boolean setProcessDefaultNetwork(Network network) { public static boolean setProcessDefaultNetwork(Network network) {
int netId = (network == null) ? NETID_UNSET : network.netId; int netId = (network == null) ? NETID_UNSET : network.netId;
if (netId == NetworkUtils.getBoundNetworkForProcess()) { if (netId == NetworkUtils.getBoundNetworkForProcess()) {
@@ -3257,6 +3277,7 @@ public class ConnectivityManager {
* {@link IllegalStateException}. Use {@link #getBoundNetworkForProcess} instead. * {@link IllegalStateException}. Use {@link #getBoundNetworkForProcess} instead.
* {@code getBoundNetworkForProcess} is a direct replacement. * {@code getBoundNetworkForProcess} is a direct replacement.
*/ */
@Deprecated
public static Network getProcessDefaultNetwork() { public static Network getProcessDefaultNetwork() {
int netId = NetworkUtils.getBoundNetworkForProcess(); int netId = NetworkUtils.getBoundNetworkForProcess();
if (netId == NETID_UNSET) return null; if (netId == NETID_UNSET) return null;
@@ -3301,6 +3322,7 @@ public class ConnectivityManager {
* @hide * @hide
* @deprecated This is strictly for legacy usage to support {@link #startUsingNetworkFeature}. * @deprecated This is strictly for legacy usage to support {@link #startUsingNetworkFeature}.
*/ */
@Deprecated
public static boolean setProcessDefaultNetworkForHostResolution(Network network) { public static boolean setProcessDefaultNetworkForHostResolution(Network network) {
return NetworkUtils.bindProcessToNetworkForHostResolution( return NetworkUtils.bindProcessToNetworkForHostResolution(
network == null ? NETID_UNSET : network.netId); network == null ? NETID_UNSET : network.netId);

View File

@@ -74,6 +74,7 @@ public class NetworkUtils {
* *
* @deprecated This is strictly for legacy usage to support startUsingNetworkFeature(). * @deprecated This is strictly for legacy usage to support startUsingNetworkFeature().
*/ */
@Deprecated
public native static boolean bindProcessToNetworkForHostResolution(int netId); public native static boolean bindProcessToNetworkForHostResolution(int netId);
/** /**