Skip to content
Snippets Groups Projects
Commit 9b5334db authored by wangshengrjxtjcb's avatar wangshengrjxtjcb Committed by Cherrypicker Worker
Browse files

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
(cherry picked from https://android-review.googlesource.com/q/commit:fd5d3d90e1da7411104902ddfe859ebd0e4a02fb)
Merged-In: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
Change-Id: I5edfcf64aca5d2d34325d722dd29fab41bcf2600
parent f8d29e40
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -4526,7 +4526,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
// because they lost all their requests or because their score isn't good)
// then they would disconnect organically, report their new state and then
// disconnect the channel.
if (nai.networkInfo.isConnected()) {
if (nai.networkInfo.isConnected() || nai.networkInfo.isSuspended()) {
nai.networkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED,
null, null);
}
......
......@@ -17949,7 +17949,6 @@ public class ConnectivityServiceTest {
mCellAgent.expectDisconnected();
waitForIdle();
 
// TODO (aosp/2583410): update following check to verifyClatdStop
verifyNeverClatdStop(null /* inOrder */, MOBILE_IFNAME);
verifyClatdStop(null /* inOrder */, MOBILE_IFNAME);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment