Move mPendingFrozenUids empty check to destroyPendingSockets
Test: ConnectivityServiceTest Bug: 300681644 Change-Id: Ic31f6b1ccea8bab8cce948736b74cf3e8e7fb2ba
This commit is contained in:
parent
dff5df5b65
commit
333f01d303
1 changed files with 5 additions and 7 deletions
|
|
@ -3380,6 +3380,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
|
||||
private void destroyPendingSockets() {
|
||||
ensureRunningOnConnectivityServiceThread();
|
||||
if (mPendingFrozenUids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
mDeps.destroyLiveTcpSocketsByOwnerUids(mPendingFrozenUids);
|
||||
|
|
@ -3403,10 +3406,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
isCellNetworkActivity = params.label == TRANSPORT_CELLULAR;
|
||||
}
|
||||
|
||||
if (mDelayDestroySockets
|
||||
&& params.isActive
|
||||
&& isCellNetworkActivity
|
||||
&& !mPendingFrozenUids.isEmpty()) {
|
||||
if (mDelayDestroySockets && params.isActive && isCellNetworkActivity) {
|
||||
destroyPendingSockets();
|
||||
}
|
||||
}
|
||||
|
|
@ -3424,9 +3424,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
final boolean isNewNetworkCellular = newNetwork != null
|
||||
&& newNetwork.networkCapabilities.hasTransport(TRANSPORT_CELLULAR);
|
||||
|
||||
if (isOldNetworkCellular
|
||||
&& !isNewNetworkCellular
|
||||
&& !mPendingFrozenUids.isEmpty()) {
|
||||
if (isOldNetworkCellular && !isNewNetworkCellular) {
|
||||
destroyPendingSockets();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue