Log an event whenever we lose the default network.
Change-Id: Ia71865a90b2db5dc0d3ad627563a6b1f99686f04
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 0a8b65d..d8b3a97 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2206,6 +2206,12 @@
}
mLegacyTypeTracker.remove(nai, wasDefault);
rematchAllNetworksAndRequests(null, 0);
+ if (wasDefault && getDefaultNetwork() == null) {
+ // Log that we lost the default network and there is no replacement.
+ final int[] transportTypes = new int[0];
+ ConnectivityServiceChangeEvent.logEvent(NETID_UNSET, nai.network.netId,
+ transportTypes);
+ }
if (nai.created) {
// Tell netd to clean up the configuration for this network
// (routing rules, DNS, etc).