History log of /frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cf4c2c637268b1a2979e20a8b5644916777a02a4 01-Jul-2015 Paul Jensen <pauljensen@google.com> Fix missing onLost NetworkCallbacks when network loses capability

If a network no longer satisfies a NetworkRequest, send the onLost
NetworkCallback. If it was a real request (not listen) then update
the NetworkFactories.

To test this change I created a little infrastructure to fake
different Internet connectivity probe results during tests. This
allowed me to rewrite some of ConnectivityServiceTest's logic for
validating networks. This brought to light a couple issues that
I had to address to keep tests passing:
1. testUnlingeringDoesNotValidate was relying on a bad side-effect
of my old method of ConnectivityServiceTest's logic for
validating networks, so I rewrote the test.
2. ConnectivityService was not sending out NetworkCallbacks for
WiFi when Cellular was validated. I'm including a fix for this
in this CL also.

Bug:22220234
Change-Id: I29314f38189817f8b2561a213c4f9e8522696663
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
e098854c41a72b22f4174bc623e8e93cde8d7331 25-Jun-2015 Paul Jensen <pauljensen@google.com> Fallback to Cellular if WiFi fails to validate

Previously, once a network validated, for the purposes of comparing networks
to select the default network, we always considered it validated.
With this change if a network later fails to validate, we'll take this latest
validation result into account. This means if WiFi and cellular are up
(e.g. if we recently switched from cellular->WiFi, and cellular is now
lingering) and both are validated, but for some reason WiFi fails a validation,
cellular will become the default network connection.

Bug:20896761
Change-Id: I858aa10c1aaec5cd9032067f960963409107bdb1
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
85cf78edc92b85ec90e91de42b14b84e202260f3 25-Jun-2015 Paul Jensen <pauljensen@google.com> Prepare some ConnectivityService logic for fallback to Cellular change

Reduce the duplication of some logic so when falling back to Cellular
when WiFi fails to validate is enabled, there's less chance for bugs
and failures:
1. De-duplicate several Network vs NetworkRequest matching functions
2. Remove the very tricky nascent logic by adding a simple "lingering" bit.

Bug:20896761
Change-Id: I21da9e827eec9cfd6835fcaa650192b9186ed053
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
1c7ba0285b3fe8de479d6c09b2ff45572913c2cb 16-Jun-2015 Paul Jensen <pauljensen@google.com> Fix missing NetworkCallbacks for NET_CAPABILITY_VALIDATED changes

Without this fix if a listening NetworkRequest with NET_CAPABILITY_VALIDATED
is submitted after a network has been validated but failed the most recent
validation attempt, the NetworkRequest will never receive callbacks.

Bug: 21343774
Change-Id: I6fa6d563c9a6f278b20e645776b707559033b249
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
3d194eae6f658ed865b2d3b748f8b83834c877ab 16-Jun-2015 Paul Jensen <pauljensen@google.com> Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL

Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
3d911469a190437fe936103e861bfa171841fbd6 12-Jun-2015 Paul Jensen <pauljensen@google.com> Don't send spurious onAvailable NetworkCallbacks when rematching

Bug:21762680
Change-Id: Ia701045dffc666fe75fba0e1771872147e37179a
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
d49159f4e997faae6ef4141b667ad6fef74a6724 14-May-2015 Lorenzo Colitti <lorenzo@google.com> Don't display the "no Internet access" prompt on captive portals.

Bug: 20081183
Bug: 21066461
Change-Id: Idc71844a604f9ca655411c6916de256780ea4586
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
cb43ebb3604d45da8677b8d19c935f0ace08ea53 16-Apr-2015 Vinit Deshpande <vinitd@google.com> Merge "am b5e0cfb..557d2f5 from mirror-m-wireless-internal-release"
e03c3c7edf54854ed22adf1e55b27b2408c4c66a 03-Apr-2015 Lorenzo Colitti <lorenzo@google.com> Prompt if a network without an Internet connection is selected

When a network is explicitlySelected, keep it connected but do
not automatically switch to it. Instead, attempt to validate it,
and if 8 seconds have passed and the network is not yet
validated, prompt the user asking whether to switch to it anyway.

Bug: 20081183
Change-Id: I03a8459eb39979e3dc8e94662b85a44605dd7e69
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
31a94f48bf8014cf6a1127bd23cf9a8541a9abed 13-Feb-2015 Paul Jensen <pauljensen@google.com> Add ConnectivityManager.getActiveNetwork().
Rework NetID allocation in ConnectivityService so registerNetworkAgent() can
return the allocated NetID.

Bug: 19416463
Change-Id: I68e395552cf27422c80b4dfae5db5d56a0d68f5d
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
7b42f399430d5d4ace4efbee225bbd3ecd2d4146 17-Dec-2014 Lorenzo Colitti <lorenzo@google.com> Add a lastValidated bit and use it when reporting capabilities.

When we switched the way the status bar determines if a
connection is validated from using INET_CONDITION_ACTION
broadcasts to calling getDefaultNetworkCapabilitiesForUser(),
the statusbar stopped displaying ! when a network stopped having
working Internet connectivity. This is because the validated bit
is never set to false once a network is validated.

Fix this, hopefully temporarily, by introducing a new validated
bit that does go back to being false when a network no longer
has working connectivity, and use that bit in
getDefaultNetworkCapabilitiesForUser().

Bug: 18777225
Change-Id: I991c068be50252391d0e64c647fcf2e053dc82f9
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
d3b8a3e77696ecd90ce59a869aaadf1e7804a9c8 17-Dec-2014 Lorenzo Colitti <lorenzo@google.com> Rename validated to everValidated.

This is a straight rename and thus a complete no-op from a
functionality perspective.

Bug: 18777225
Change-Id: I140d7640f1460c869a311294873772819a7a7059
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
b10e37fd1c3a95f7e621eed234c2491eb71241e2 25-Nov-2014 Paul Jensen <pauljensen@google.com> Reap unvalidated networks that have no chance of becoming highest scoring.

These networks are unneeded and waste battery. We won't bring up these
networks in the first place if they have no chance of becoming highest scoring.
This change handles the case where these networks are already up and
transition to a state where they have no chance of becoming highest scoring.
This happens when another network validates with a score higher than this
network can ever hope to attain.

bug:18489123
Change-Id: I77a96a72e250e25e44e0c50e7a928af8b35bb6ab
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
0cc1732cfb9d68779449b4c12661b4df6bfc720b 25-Nov-2014 Paul Jensen <pauljensen@google.com> Remember to cancel lingering when a network again satsifies a NetworkRequest.

When WiFi's score drops and then comes back up we would previously linger
WiFi but forget to cancel the linger timeout, so 30s later WiFi would
unexpectedly tear down. Also, make sure this is only done for created
Networks as "created" is the signal to initialy match Networks and requests.

bug:18169560
Change-Id: Ia69b110f6473371e556c60b950253758e023b7aa
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
be3736d38774210549deb2999bb226d83a29f1ee 26-Nov-2014 Paul Jensen <pauljensen@google.com> Merge "Don't let NetworkMonitor state stop user-initiated transitions." into lmp-mr1-dev
71b645fe9cb8106dfcbf025a3fd7f58698c051bb 13-Oct-2014 Paul Jensen <pauljensen@google.com> Don't let NetworkMonitor state stop user-initiated transitions.

GCM can call reportInetCondition() at any time which can cause
the NetworkMonitor to transition states to reevaluate at any time.
Previously we were only listening for users clicking the sign-in
notificaiton or completing sign-in when in the appropriate state.
With this change NetworkMonitor's state does not stop us from
listening for the user's actions.

bug:17917929
Change-Id: Ic1da31d90f7090e5fc111874cb7c37d505aaf590
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
2c311d61eaf331818e601f97485f88c4cf26384d 17-Nov-2014 Paul Jensen <pauljensen@google.com> Don't bother validating networks that don't satisfy the default request.

The only immediate change in behavior is not validating untrusted networks.

bug:18299572
bug:18394654

Change-Id: I8d626baf37db0bd0f55ddf3af8a0abf094a12369
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
954394653dad05838235f48244a4320893e0f0cf 09-Oct-2014 Lorenzo Colitti <lorenzo@google.com> Support more than one clatd at a time.

1. Make Nat464Xlat a per-network object, one for every network
requiring clat, instead of a ConnectivityService singleton.
2. Make the NetworkManagementService clatd commands take an
interface.
3. When we attempt to start clatd on a network, store its
Nat464Xlat object in the NetworkAgentInfo, so we have an
authoritative way of knowing whether clat is running on a
given network.
4. Rework Nat464Xlat, hopefully simplifying it.

Bug: 12111730
Change-Id: I1fa5508ef020cd1c3d1c7a1f7b06370ac5fc2ae2
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
e73cc4646bed3926024c9f54ca59e3a82a97b56c 08-Sep-2014 Robert Greenwalt <rgreenwalt@google.com> Add NetworkAgent event for ExplicitlySelected

Lets Wifi tell us when the user selected this AP vs auto-connected.

bug:17396168
Change-Id: I6e067ab62ed49040629aa31fe07ff880d3d542f0
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
2161a8ea123134ee3f9a10c0f8f56aabd8289f69 11-Sep-2014 Paul Jensen <pauljensen@google.com> Better handling of unvalidated networks.

Give unvalidated networks penalized scores and allow them to satisfy
requests.

Previously unvalidated networks were never allowed to satisfy
NetworkRequests and so never caused CONNECTIVITY_ACTION broadcasts.
Previously if there were no other networks present an unvalidated
network would still be made the default. This change formalizes
this behavior using our existing network score logic by assigning
unvalidated networks a highly penalized score.

bug:16358003
bug:17364306
Change-Id: I28fcd6f5ac4b52a4d1c234c472cfa8ba998bcc6f
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
7ccd3dfd53d8d45c447398ff137f052865dfd3b3 29-Aug-2014 Paul Jensen <pauljensen@google.com> Implement ConnectivityManager.reportBadNetwork() to trigger network validation.

Network traffic used to perform the network validation is billed to the UID of
the caller of reportBadNetwork. This change does not change the actions taken
upon validation failing or succeeding: NetworkMonitor will show the sign-in
notification if a captive portal is found. NetworkMonitor will inform
ConnectivityService if a network tests functional. NetworkMonitor will not
take action if a network lacks any connectivity.
Also, remove an unused Thread that was confusing bandwidth billing.

bug:17326268
Change-Id: I7fea23480af54211004a0a1c535a71c2793f21bb
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
60061a6ebf4ef758c4a47d210de0e5be2484be5b 05-Aug-2014 Paul Jensen <pauljensen@google.com> Avoid reusing a currently active NetID.

There are only a limited number (65526) of NetIDs so the chance for reusing
one exists. Reusing a currently active NetID will cause problems like netd
failures and overwriting entries in mNetworkForNetId.

bug:16815182

Change-Id: Ib75302beae3179c3f3b90c345cf4d2cf5f4ad2be
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
eec75412a971a5ccb769364120c769c331946eb3 04-Aug-2014 Paul Jensen <pauljensen@google.com> Stop ConnectivityService from talking to netd about uncreated networks.

This avoids logged netd errors that are red-herrings.

bug:16667349
Change-Id: I5d6f1681f1d38dab0af4c535573a0c45c0216603
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
8cd33ed84e94036a5e1201485af7603dc6fb0d9b 24-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Implement support for bypassable VPNs.

Bypassable VPNs grab all traffic by default (just like secure VPNs), but:
+ They allow all apps to choose other networks using the multinetwork APIs.
If these other networks are insecure ("untrusted"), they will enforce that the
app holds the necessary permissions, such as CHANGE_NETWORK_STATE.
+ They support consistent routing. If an app has an existing connection over
some other network when the bypassable VPN comes up, it's not interrupted.

Bug: 15347374
Change-Id: Iaee9c6f6fa8103215738570d2b65d3fcf10343f3
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
6bc2c2c34f2b23eae79ad733c97a691734055c4f 07-May-2014 Paul Jensen <pauljensen@google.com> Convert Vpn from NetworkStateTracker to NetworkAgent.

This eliminates the need for the ConnectivityService.VpnCallback class.
This requires shifting VPNs to the new "network" netd API.
VpnService.protect() is modified to no longer go through ConnectivityService.
NetworkCapabilities is extended to add a transport type for VPNs and a
capability requiring a non-VPN (so the default NetworkRequest isn't satisfied
by a VPN).

bug:15409918
Change-Id: Ic4498f1961582208add6f375ad16ce376ee9eb95
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
2c7bf2cb46024eb87aec4b5ac0fa15477cc14f7a 24-Jun-2014 Robert Greenwalt <rgreenwalt@google.com> Clean up and add some Network logging.

Dumps the netid for the Network and adds that to the NetworkAgentInfo.

Change-Id: Id9fbcc55ca55bf1a020f747f0c44902efb1b5f87
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
b90b20b5d57809da5c91bac9ff45c2ac323d9637 03-Jun-2014 Robert Greenwalt <rgreenwalt@google.com> Fix Legacy NetworkInfo API

Make the connectivity changed broadcasts send correct NetworkInfos.
Also update the results of getNetwork.

bug:15290306
bug:15191336
bug:14993207
Change-Id: Ie99ad25f3ebb90d18348e7013761b139e7481866
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
71bf33a02f49444fbfa35b267c70592f3b07a07d 16-May-2014 Robert Greenwalt <rgreenwalt@google.com> Rewrite startUsingNetworkFeature for new API

bug:14993207
Change-Id: I041a80faa07bf3094af13a6c606f3b15aa03f789
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
9258c64bef1a01fe89bc7c1fa402c44c0e6a1255 27-Mar-2014 Robert Greenwalt <rgreenwalt@google.com> Add Multinetwork API

Change-Id: I3a9cef0d416db96d05098dd989ee3fef3b1e9274
(cherry picked from commit cc5e6afa1ba0bef099bcb21a64a36bc2bf7951db)
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
ca8f16ad14819ba17f5ff3d2e2bf6fbc9bbaa9f7 09-May-2014 Paul Jensen <pauljensen@google.com> Add NetworkMonitor.
At present the network evaluation / captive portal detection
is disabled pending addition of API to bind socket to network.

Change-Id: I5d1f5dc86d4dd9481d52dd45d6da0732054c8315
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
7b81602f3c18df8a4ca0342c514af8f7e394c0d7 19-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> Enabling internal msg apis

NetworkFactory and NetworkAgent. First trying with wifi and
getting rid of WifiStateTracker.

Conflicts:
api/current.txt
services/core/java/com/android/server/ConnectivityService.java

Change-Id: I7f0ec13d7d8988b32f3c6dc71f72012f3349fe02
/frameworks/base/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java