Merge "Fix agents disconnecting in SUSPENDED state."

This commit is contained in:
Motomu Utsumi
2023-05-17 01:59:18 +00:00
committed by Gerrit Code Review
3 changed files with 20 additions and 3 deletions

View File

@@ -333,6 +333,24 @@ public class NetworkInfo implements Parcelable {
}
}
/**
* Indicates whether this network is suspended.
* @deprecated Apps should instead use the
* {@link android.net.ConnectivityManager.NetworkCallback} API to
* learn about connectivity changes. See
* {@link ConnectivityManager#registerDefaultNetworkCallback} and
* {@link ConnectivityManager#registerNetworkCallback}. These will
* give a more accurate picture of the connectivity state of
* the device and let apps react more easily and quickly to changes.
* @hide
*/
@Deprecated
public boolean isSuspended() {
synchronized (this) {
return mState == State.SUSPENDED;
}
}
/**
* Indicates whether network connectivity is possible. A network is unavailable
* when a persistent or semi-persistent condition prevents the possibility