Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3176ea0 authored by Junyu Lai's avatar Junyu Lai Committed by android-build-merger
Browse files

Merge "Deprecate NetworkInfo" am: a244ccd8

am: df8ed152

Change-Id: Ia646a8754bcd5ef62573e3b1730df3987bf9fd15
parents 4b4210f3 df8ed152
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -27223,7 +27223,7 @@ package android.net {
    method public void addDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
    method public void addDefaultNetworkActiveListener(android.net.ConnectivityManager.OnNetworkActiveListener);
    method public boolean bindProcessToNetwork(android.net.Network);
    method public boolean bindProcessToNetwork(android.net.Network);
    method public android.net.Network getActiveNetwork();
    method public android.net.Network getActiveNetwork();
    method public android.net.NetworkInfo getActiveNetworkInfo();
    method public deprecated android.net.NetworkInfo getActiveNetworkInfo();
    method public deprecated android.net.NetworkInfo[] getAllNetworkInfo();
    method public deprecated android.net.NetworkInfo[] getAllNetworkInfo();
    method public android.net.Network[] getAllNetworks();
    method public android.net.Network[] getAllNetworks();
    method public deprecated boolean getBackgroundDataSetting();
    method public deprecated boolean getBackgroundDataSetting();
@@ -27234,7 +27234,7 @@ package android.net {
    method public int getMultipathPreference(android.net.Network);
    method public int getMultipathPreference(android.net.Network);
    method public android.net.NetworkCapabilities getNetworkCapabilities(android.net.Network);
    method public android.net.NetworkCapabilities getNetworkCapabilities(android.net.Network);
    method public deprecated android.net.NetworkInfo getNetworkInfo(int);
    method public deprecated android.net.NetworkInfo getNetworkInfo(int);
    method public android.net.NetworkInfo getNetworkInfo(android.net.Network);
    method public deprecated android.net.NetworkInfo getNetworkInfo(android.net.Network);
    method public deprecated int getNetworkPreference();
    method public deprecated int getNetworkPreference();
    method public byte[] getNetworkWatchlistConfigHash();
    method public byte[] getNetworkWatchlistConfigHash();
    method public static deprecated android.net.Network getProcessDefaultNetwork();
    method public static deprecated android.net.Network getProcessDefaultNetwork();
@@ -27268,14 +27268,14 @@ package android.net {
    field public static final deprecated int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
    field public static final deprecated int DEFAULT_NETWORK_PREFERENCE = 1; // 0x1
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL = "android.net.extra.CAPTIVE_PORTAL";
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL = "android.net.extra.CAPTIVE_PORTAL";
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL";
    field public static final java.lang.String EXTRA_CAPTIVE_PORTAL_URL = "android.net.extra.CAPTIVE_PORTAL_URL";
    field public static final java.lang.String EXTRA_EXTRA_INFO = "extraInfo";
    field public static final deprecated java.lang.String EXTRA_EXTRA_INFO = "extraInfo";
    field public static final java.lang.String EXTRA_IS_FAILOVER = "isFailover";
    field public static final deprecated java.lang.String EXTRA_IS_FAILOVER = "isFailover";
    field public static final java.lang.String EXTRA_NETWORK = "android.net.extra.NETWORK";
    field public static final java.lang.String EXTRA_NETWORK = "android.net.extra.NETWORK";
    field public static final deprecated java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final deprecated java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final java.lang.String EXTRA_NETWORK_REQUEST = "android.net.extra.NETWORK_REQUEST";
    field public static final java.lang.String EXTRA_NETWORK_REQUEST = "android.net.extra.NETWORK_REQUEST";
    field public static final java.lang.String EXTRA_NETWORK_TYPE = "networkType";
    field public static final java.lang.String EXTRA_NETWORK_TYPE = "networkType";
    field public static final java.lang.String EXTRA_NO_CONNECTIVITY = "noConnectivity";
    field public static final java.lang.String EXTRA_NO_CONNECTIVITY = "noConnectivity";
    field public static final java.lang.String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
    field public static final deprecated java.lang.String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
    field public static final java.lang.String EXTRA_REASON = "reason";
    field public static final java.lang.String EXTRA_REASON = "reason";
    field public static final int MULTIPATH_PREFERENCE_HANDOVER = 1; // 0x1
    field public static final int MULTIPATH_PREFERENCE_HANDOVER = 1; // 0x1
    field public static final int MULTIPATH_PREFERENCE_PERFORMANCE = 4; // 0x4
    field public static final int MULTIPATH_PREFERENCE_PERFORMANCE = 4; // 0x4
@@ -27575,10 +27575,10 @@ package android.net {
    field public static final int TRANSPORT_WIFI_AWARE = 5; // 0x5
    field public static final int TRANSPORT_WIFI_AWARE = 5; // 0x5
  }
  }
  public class NetworkInfo implements android.os.Parcelable {
  public deprecated class NetworkInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int describeContents();
    method public deprecated android.net.NetworkInfo.DetailedState getDetailedState();
    method public deprecated android.net.NetworkInfo.DetailedState getDetailedState();
    method public java.lang.String getExtraInfo();
    method public deprecated java.lang.String getExtraInfo();
    method public deprecated java.lang.String getReason();
    method public deprecated java.lang.String getReason();
    method public deprecated android.net.NetworkInfo.State getState();
    method public deprecated android.net.NetworkInfo.State getState();
    method public deprecated int getSubtype();
    method public deprecated int getSubtype();
@@ -27594,7 +27594,7 @@ package android.net {
    field public static final android.os.Parcelable.Creator<android.net.NetworkInfo> CREATOR;
    field public static final android.os.Parcelable.Creator<android.net.NetworkInfo> CREATOR;
  }
  }
  public static final class NetworkInfo.DetailedState extends java.lang.Enum {
  public static final deprecated class NetworkInfo.DetailedState extends java.lang.Enum {
    method public static android.net.NetworkInfo.DetailedState valueOf(java.lang.String);
    method public static android.net.NetworkInfo.DetailedState valueOf(java.lang.String);
    method public static final android.net.NetworkInfo.DetailedState[] values();
    method public static final android.net.NetworkInfo.DetailedState[] values();
    enum_constant public static final android.net.NetworkInfo.DetailedState AUTHENTICATING;
    enum_constant public static final android.net.NetworkInfo.DetailedState AUTHENTICATING;
@@ -27612,7 +27612,7 @@ package android.net {
    enum_constant public static final android.net.NetworkInfo.DetailedState VERIFYING_POOR_LINK;
    enum_constant public static final android.net.NetworkInfo.DetailedState VERIFYING_POOR_LINK;
  }
  }
  public static final class NetworkInfo.State extends java.lang.Enum {
  public static final deprecated class NetworkInfo.State extends java.lang.Enum {
    method public static android.net.NetworkInfo.State valueOf(java.lang.String);
    method public static android.net.NetworkInfo.State valueOf(java.lang.String);
    method public static final android.net.NetworkInfo.State[] values();
    method public static final android.net.NetworkInfo.State[] values();
    enum_constant public static final android.net.NetworkInfo.State CONNECTED;
    enum_constant public static final android.net.NetworkInfo.State CONNECTED;
+13 −0
Original line number Original line Diff line number Diff line
@@ -187,13 +187,19 @@ public class ConnectivityManager {
     * is for a network to which the connectivity manager was failing over
     * is for a network to which the connectivity manager was failing over
     * following a disconnect on another network.
     * following a disconnect on another network.
     * Retrieve it with {@link android.content.Intent#getBooleanExtra(String,boolean)}.
     * Retrieve it with {@link android.content.Intent#getBooleanExtra(String,boolean)}.
     *
     * @deprecated See {@link NetworkInfo}.
     */
     */
    @Deprecated
    public static final String EXTRA_IS_FAILOVER = "isFailover";
    public static final String EXTRA_IS_FAILOVER = "isFailover";
    /**
    /**
     * The lookup key for a {@link NetworkInfo} object. This is supplied when
     * The lookup key for a {@link NetworkInfo} object. This is supplied when
     * there is another network that it may be possible to connect to. Retrieve with
     * there is another network that it may be possible to connect to. Retrieve with
     * {@link android.content.Intent#getParcelableExtra(String)}.
     * {@link android.content.Intent#getParcelableExtra(String)}.
     *
     * @deprecated See {@link NetworkInfo}.
     */
     */
    @Deprecated
    public static final String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
    public static final String EXTRA_OTHER_NETWORK_INFO = "otherNetwork";
    /**
    /**
     * The lookup key for a boolean that indicates whether there is a
     * The lookup key for a boolean that indicates whether there is a
@@ -214,7 +220,10 @@ public class ConnectivityManager {
     * may be passed up from the lower networking layers, and its
     * may be passed up from the lower networking layers, and its
     * meaning may be specific to a particular network type. Retrieve
     * meaning may be specific to a particular network type. Retrieve
     * it with {@link android.content.Intent#getStringExtra(String)}.
     * it with {@link android.content.Intent#getStringExtra(String)}.
     *
     * @deprecated See {@link NetworkInfo#getExtraInfo()}.
     */
     */
    @Deprecated
    public static final String EXTRA_EXTRA_INFO = "extraInfo";
    public static final String EXTRA_EXTRA_INFO = "extraInfo";
    /**
    /**
     * The lookup key for an int that provides information about
     * The lookup key for an int that provides information about
@@ -895,7 +904,9 @@ public class ConnectivityManager {
     *
     *
     * @return a {@link NetworkInfo} object for the current default network
     * @return a {@link NetworkInfo} object for the current default network
     *        or {@code null} if no default network is currently active
     *        or {@code null} if no default network is currently active
     * @deprecated See {@link NetworkInfo}.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
    @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
    public NetworkInfo getActiveNetworkInfo() {
    public NetworkInfo getActiveNetworkInfo() {
        try {
        try {
@@ -1079,7 +1090,9 @@ public class ConnectivityManager {
     * @return a {@link NetworkInfo} object for the requested
     * @return a {@link NetworkInfo} object for the requested
     *        network or {@code null} if the {@code Network}
     *        network or {@code null} if the {@code Network}
     *        is not valid.
     *        is not valid.
     * @deprecated See {@link NetworkInfo}.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
    @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
    public NetworkInfo getNetworkInfo(Network network) {
    public NetworkInfo getNetworkInfo(Network network) {
        return getNetworkInfoForUid(network, Process.myUid(), false);
        return getNetworkInfoForUid(network, Process.myUid(), false);
+24 −0
Original line number Original line Diff line number Diff line
@@ -28,7 +28,20 @@ import java.util.EnumMap;
 * Describes the status of a network interface.
 * Describes the status of a network interface.
 * <p>Use {@link ConnectivityManager#getActiveNetworkInfo()} to get an instance that represents
 * <p>Use {@link ConnectivityManager#getActiveNetworkInfo()} to get an instance that represents
 * the current network connection.
 * the current network connection.
 *
 * @deprecated Callers should instead use the {@link ConnectivityManager.NetworkCallback} API to
 *             learn about connectivity changes, or switch to use
 *             {@link ConnectivityManager#getNetworkCapabilities} or
 *             {@link ConnectivityManager#getLinkProperties} to get information synchronously. Keep
 *             in mind that while callbacks are guaranteed to be called for every event in order,
 *             synchronous calls have no such constraints, and as such it is unadvisable to use the
 *             synchronous methods inside the callbacks as they will often not offer a view of
 *             networking that is consistent (that is: they may return a past or a future state with
 *             respect to the event being processed by the callback). Instead, callers are advised
 *             to only use the arguments of the callbacks, possibly memorizing the specific bits of
 *             information they need to keep from one callback to another.
 */
 */
@Deprecated
public class NetworkInfo implements Parcelable {
public class NetworkInfo implements Parcelable {


    /**
    /**
@@ -52,7 +65,10 @@ public class NetworkInfo implements Parcelable {
     * <tr><td><code>FAILED</code></td><td><code>DISCONNECTED</code></td></tr>
     * <tr><td><code>FAILED</code></td><td><code>DISCONNECTED</code></td></tr>
     * <tr><td><code>BLOCKED</code></td><td><code>DISCONNECTED</code></td></tr>
     * <tr><td><code>BLOCKED</code></td><td><code>DISCONNECTED</code></td></tr>
     * </table>
     * </table>
     *
     * @deprecated See {@link NetworkInfo}.
     */
     */
    @Deprecated
    public enum State {
    public enum State {
        CONNECTING, CONNECTED, SUSPENDED, DISCONNECTING, DISCONNECTED, UNKNOWN
        CONNECTING, CONNECTED, SUSPENDED, DISCONNECTING, DISCONNECTED, UNKNOWN
    }
    }
@@ -61,7 +77,10 @@ public class NetworkInfo implements Parcelable {
     * The fine-grained state of a network connection. This level of detail
     * The fine-grained state of a network connection. This level of detail
     * is probably of interest to few applications. Most should use
     * is probably of interest to few applications. Most should use
     * {@link android.net.NetworkInfo.State State} instead.
     * {@link android.net.NetworkInfo.State State} instead.
     *
     * @deprecated See {@link NetworkInfo}.
     */
     */
    @Deprecated
    public enum DetailedState {
    public enum DetailedState {
        /** Ready to start data connection setup. */
        /** Ready to start data connection setup. */
        IDLE,
        IDLE,
@@ -463,8 +482,10 @@ public class NetworkInfo implements Parcelable {
     * Set the extraInfo field.
     * Set the extraInfo field.
     * @param extraInfo an optional {@code String} providing addditional network state
     * @param extraInfo an optional {@code String} providing addditional network state
     * information passed up from the lower networking layers.
     * information passed up from the lower networking layers.
     * @deprecated See {@link NetworkInfo#getExtraInfo}.
     * @hide
     * @hide
     */
     */
    @Deprecated
    public void setExtraInfo(String extraInfo) {
    public void setExtraInfo(String extraInfo) {
        synchronized (this) {
        synchronized (this) {
            this.mExtraInfo = extraInfo;
            this.mExtraInfo = extraInfo;
@@ -488,7 +509,10 @@ public class NetworkInfo implements Parcelable {
     * Report the extra information about the network state, if any was
     * Report the extra information about the network state, if any was
     * provided by the lower networking layers.
     * provided by the lower networking layers.
     * @return the extra information, or null if not available
     * @return the extra information, or null if not available
     * @deprecated Use other services e.g. WifiManager to get additional information passed up from
     *             the lower networking layers.
     */
     */
    @Deprecated
    public String getExtraInfo() {
    public String getExtraInfo() {
        synchronized (this) {
        synchronized (this) {
            return mExtraInfo;
            return mExtraInfo;