summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lorenzo Colitti <lorenzo@google.com> 2014-10-01 00:52:34 +0000
committer Android Git Automerger <android-git-automerger@android.com> 2014-10-01 00:52:34 +0000
commit6c1d0e07840d124921fd30f04ad11b409ea73b3e (patch)
tree1f08a86938380bc1e4f21f30bdf9997d6b989a14
parent8cfba20560314a09d7e9a2fd98355109d30d57cd (diff)
parentd8f7e048281559462f9c590f9d7d48fb7fe065ce (diff)
am d8f7e048: Merge "Update LegacyTypeTracker state before sending connect broadcasts." into lmp-dev
* commit 'd8f7e048281559462f9c590f9d7d48fb7fe065ce': Update LegacyTypeTracker state before sending connect broadcasts.
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 0b1a62721fe8..85ab2490a797 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -516,11 +516,13 @@ public class ConnectivityService extends IConnectivityManager.Stub {
return;
}
- if (list.isEmpty() || isDefaultNetwork(nai)) {
+ list.add(nai);
+
+ // Send a broadcast if this is the first network of its type or if it's the default.
+ if (list.size() == 1 || isDefaultNetwork(nai)) {
maybeLogBroadcast(nai, true, type);
sendLegacyNetworkBroadcast(nai, true, type);
}
- list.add(nai);
}
/** Removes the given network from the specified legacy type list. */