summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lorenzo Colitti <lorenzo@google.com> 2020-06-26 15:06:59 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-06-26 15:06:59 +0000
commit874dec6ba89d383103630e47d2384c48131cfdab (patch)
tree0a1a8d587fb9cf59af5165131be5531f8a32ff3c
parent4619e6e1d7728c0696938e2cd509c440ddbd27e5 (diff)
parentf76c29b555b7c2a77c523e7f03e1237bd1a267c3 (diff)
Merge "Send ConnDiags event before revalidating network in CS." into rvc-dev
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 01b2e691d43a..77cd5d2ffdab 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -4323,9 +4323,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
enforceInternetPermission();
final int uid = Binder.getCallingUid();
final int connectivityInfo = encodeBool(hasConnectivity);
- mHandler.sendMessage(
- mHandler.obtainMessage(EVENT_REVALIDATE_NETWORK, uid, connectivityInfo, network));
+ // Handle ConnectivityDiagnostics event before attempting to revalidate the network. This
+ // forces an ordering of ConnectivityDiagnostics events in the case where hasConnectivity
+ // does not match the known connectivity of the network - this causes NetworkMonitor to
+ // revalidate the network and generate a ConnectivityDiagnostics ConnectivityReport event.
final NetworkAgentInfo nai;
if (network == null) {
nai = getDefaultNetwork();
@@ -4338,6 +4340,9 @@ public class ConnectivityService extends IConnectivityManager.Stub
ConnectivityDiagnosticsHandler.EVENT_NETWORK_CONNECTIVITY_REPORTED,
connectivityInfo, 0, nai));
}
+
+ mHandler.sendMessage(
+ mHandler.obtainMessage(EVENT_REVALIDATE_NETWORK, uid, connectivityInfo, network));
}
private void handleReportNetworkConnectivity(