Fix agents disconnecting in SUSPENDED state.

Network state is not changed to disconnected when a networkagent
is disconnected and network state is SUSPENDED.

So the function requiresClat return true. Clat is not stoped.

Bug: 277682237
Test: atest FrameworksNetTests

Change-Id: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
This commit is contained in:
wangshengrjxtjcb
2023-05-09 09:51:06 +08:00
committed by Motomu Utsumi
parent 4a5b06559f
commit fd5d3d90e1
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