Don't break things if a network goes back to CONNECTED.

Currently, if a network goes from CONNECTED to some other "live"
state (e.g., CONNECTING, because it's VERIFYING_POOR_LINK) and
back, ConnectivityService treats it as if a new network had
connected.  This causes it to attempt to create the network
(which fails, since a network with that netid already exists), to
trigger verification, and if the verification succeeds, to tear
down the network because the request it's satisfying is already
satisfied by the network itself.

Instead, if creating the network fails, assume it's because the
network had already been created, and bail out.

Also, when validation completes, ignore NetworkRequests that were
being served by the same NetworkAgent as before.

Bug: 15244052

(cherry picked from commit cfff026ec47afc7e31f60f80e3deea7f4e2f9be5)

Change-Id: I52c2220e8f1d98fca765880be3040593e92722ed
1 file changed
tree: 55feefe86d8a20efe75da4d164e433b1a969f572
  1. core/
  2. services/
  3. tests/