Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
Add NetworkAgent event for ExplicitlySelected
Lets Wifi tell us when the user selected this AP vs auto-connected.

bug:17396168
Change-Id: I6e067ab62ed49040629aa31fe07ff880d3d542f0

Robert Greenwalt   commited 2014-09-16 17:03:59 -07:00
cea86b065f
Report Network status to NetworkAgent.
Currently just valid/invalid based on NetworkMonitor findings.

Changed NetworkMonitor to start out in default state since starting in Offline causes
a spurious invalid report at creation time.

Added some logging.

bug:17395269
Change-Id: I9ae650b561834d8f8979033744d97df852e76df9

Robert Greenwalt   commited 2014-09-14 07:43:10 -07:00
135a724164
Update Inet state when NetworkMonitor re-evaluates a network.
Previously the Inet state (the little exclamation mark beside the WiFi
and Cellular bars) only transitioned from bad to good once.  With this
change it can transition back to bad (and later to good again) if a network
re-evaluation is triggered, say by ConnectivityManager.reportBadNetwork.
Also, avoid triggering re-evaluation in two unwanted cases.

bug:16214361
Change-Id: I7856724249ffcbb0945276dcf45019876231fdaf

Paul Jensen   authored and   Robert Greenwalt   commited 2014-09-12 23:02:28 +00:00
5877e73315
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

Paul Jensen   commited 2014-09-12 13:32:00 -04:00
19d1d36ec0
Merge "Don't accept score below 0." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-09-10 19:30:22 +00:00
6df9633596
Don't accept score below 0.
Network Factories are allowed to go below, but networks need to be
constrained.  Allowing the network to go below 0 meant that -1 could
sometimes leak through and foul the logic.

The core of 17361330 will be fixed when we stop sending scores for
listens to NetworkFactories, but it exposed this issue too.  Summary:

1 - add a network listener.  This isn't  a request so it's not sent
to networks.
2 - alter your score (ethernet sets score to -1 when the link goes
down) (16:07:39.782)
3 - a bug in ConnectivityService causes score changes to get sent for
all network requests and network listeners causing NetworkFactories
to no see 2 entities.  This bug will be fixed by a pending change
(https://googleplex-android-review.googlesource.com/#/c/540840/).
This causes the ethernet NetworkFactory to see two entities, both
served by networks of score -1.  (16:07:39.989)
4 - disconnect Ethernet - this only sends 0 scores for known
requests, not network listeners.  Had it been sent for both entities
they both would have evaluated that the networkfactory score (-1)
was lower than the request score (0) and both released their
refcount. (16:08:03.147)
5 - this means the listener is tracked by the EthernetNetworkFactory
with a score of -1 while the factory itself has a score of -1 so the
network release isn't called.

bug:17361330
Change-Id: Ife34ca0f9c233dd3c3df80f6fea580af43afcdeb

Robert Greenwalt   commited 2014-09-10 10:39:37 -07:00
4a4ecd2c5f
Merge "Stop logging false error when lingering completes." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-09-09 10:59:42 +00:00
a826bcd428
Merge "Don't send listening NetworkRequests to NetworkFactories." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-09-09 10:59:20 +00:00
57250f0cae
Merge "Implement ConnectivityManager.reportBadNetwork() to trigger network validation." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-09-09 10:58:59 +00:00
49fe68628d
Stop logging false error when lingering completes.
When lingering completes ConnectivityService would log an error message
saying the Network still had NetworkRequests.  Fixed by ignoring
listening NetworkRequests which aren't a problem.

Change-Id: Ie78a1f91c47b012eae28a377dd77bee2cfcbde3b

Paul Jensen   commited 2014-09-07 13:16:03 -04:00
4fd960b44e
Don't send listening NetworkRequests to NetworkFactories.
We were doing this when a NetworkAgent updated its score.

bug:17393458
Change-Id: Id19ffc36b942b7112da70dfadd6abd57fcd128bd

Paul Jensen   commited 2014-09-07 13:10:07 -04:00
e252f4e0a0
Reserve NetIds 1..50 for OEM use.
Also reserve 51..100 for our use.

Bug: 17303534
Change-Id: Id082368b493dc3c5b5c479e51d273458d80ec6aa

Sreeram Ramachandran   commited 2014-09-05 16:24:51 -07:00
0fde0bec00
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

Paul Jensen   commited 2014-09-04 12:02:52 -04:00
57d231cfaa
Kill the NetworkInfo(int type) constructor. IT'S A TRAP!
This constructor does nothing, including doing nothing with its
only argument. This causes it to return a NetworkInfo for
TYPE_MOBILE no matter what was passed in.

Bug: 16610051
Change-Id: I4ccd5ec050f7824fb06496c00fcd7901defeb7bd

Lorenzo Colitti   commited 2014-08-29 18:34:49 -07:00
786ae5df7d
Pass the socket mark for DNS queries to dnsmasq.
This makes tethered clients use the correct DNS servers when
tethering to non-default networks like the DUN APN.

Bug: 16357676
Change-Id: I8933b6de198a92c2aaf0291931ace8966ddba275

Lorenzo Colitti   commited 2014-08-29 10:21:58 -07:00
2b2d73c7fd
Change TelephonyManager method name to accurately reflect functionality.
Bug: 17163860
Change-Id: I4390d79c49831454146a42b89520a16984c5f260

Diego Pontoriero   commited 2014-08-28 13:50:36 -07:00
4546d44570
Merge "Clean up Connectivity Logging." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-28 16:29:55 +00:00
64c07932e3
Clean up Connectivity Logging.
bug:17285109
Change-Id: I61b98aa636996f8d4915fd954d49a22c20cfe9ab

Robert Greenwalt   commited 2014-08-27 14:49:14 -07:00
721f237014
Merge "Fix to allow removing sign-in notification when network removed." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-08-26 23:58:40 +00:00
276d444af9
Fix to allow removing sign-in notification when network removed.
When the NetworkMonitor is told a network disconnected and a sign-in
notification has been shown to the user, the NetworkMonitor requests
the notification be removed.  This request goes to the
ConnectivityService who may have already removed the NetworkAgentInfo
from mNetworkForNetId so we cannot look up the NetID in there.
There is no harm in allowing notification hiding for networks that
are disconnected as the notification logic does not effect the
Network state (like the validation message that caused the addition
of the Network liveness check).

bug:17261757
Change-Id: Id0a299e230ae37e641ac2faeebc45550e27c1fa4

Paul Jensen   commited 2014-08-25 22:45:39 -04:00
c3deb11f7b
Merge "Remove listen requests properly." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-25 23:12:46 +00:00
286ed87824
Remove listen requests properly.
https://googleplex-android-review.googlesource.com/#/c/527772/
correctly stopped adding listen requests to the mNetworkForRequestId
sparse array, but when we remove requests, if it's not getting
serviced by a network, we don't remove it from the network.  That
means that when we go to send a notification for that network we have
a request affiliated with the network, but don't have data for the
request and hit this NPE.

If it's not a request, don't do the optimization and remove it only
from the network servicing the request, but instead scan all networks
and remove it from each, if found.

bug:17239054
Change-Id: I49165ed08c224ef20f703469f9ce39df5f21b163

Robert Greenwalt   commited 2014-08-25 15:42:10 -07:00
bc5794d2ae
Update the http proxy on LinkProperty change.
bug:16308315
Change-Id: Ie44634a9223f289903c09653f77a998d3a344654

Robert Greenwalt   commited 2014-08-23 09:51:35 -07:00
63815c59c5
Allow NetworkRequest release from the system process.
Otherwise attempts to release that are triggered by the binder death
receipient will be rejected.

Bug: 17187437
Change-Id: If3924d82dba69c572708e04c11d17ed25ae6870d

Jeff Davidson   commited 2014-08-21 16:21:29 -07:00
7af793a5c3
Merge "Change the NetworkInfo for disconnected types." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-21 21:02:19 +00:00
140517a1c7
Change the NetworkInfo for disconnected types.
Don't send out NetworkInfos with UNKNOWN state for disconnected
networks - use DISCONNECTED.

bug:17095670
Change-Id: I863bebadc1f9a666572958b49d5e62809f485e5d

Robert Greenwalt   commited 2014-08-21 09:19:46 -07:00
7d5756de8c
Merge "Fix findConnectionTypeForIface." into lmp-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-08-21 16:08:11 +00:00
a2d08df0a6
Fix findConnectionTypeForIface.
This is used by the VPN to notice when its underlying connection
has gone away. I'm fixing this using network types and not
NetworkCapabilities because

1. I don't know of a way to use the new API to get callbacks for
   a specific network. You can get them based on capabilities,
   but it's not clear how to construct a NetworkCapabilities
   object that will only match a specific network, or only match
   the default network.
2. It's a smaller change.

Bug: 15070628
Change-Id: Id6a6a183da83636c0859db4c954093bd684c01ea

Lorenzo Colitti   commited 2014-08-20 09:11:14 -07:00
f47cdb166a
Added notification color to all system notifications
Bug: 17128331
Change-Id: I81a94510ef51b99916f314c0dd65852426a1fbeb

Selim Cinek   commited 2014-08-20 14:25:18 +02:00
f84112f025
Add tcp buffer size conduit to NetworkAgent.
bug: 16549611
Change-Id: I7d97dedea2c7c1aed2eccb185645889424508591

Robert Greenwalt   commited 2014-08-17 15:14:29 -07:00
0380686903
Merge "Avoid reusing a currently active NetID." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-16 04:32:18 +00:00
657214a0a9
Merge "Fix listening NetworkRequests to listen for all networks." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-20 20:15:45 +00:00
0584b0615c
Merge "Fix CS/NetworkMonitor race." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-20 20:15:45 +00:00
bcb17155a2
Merge "Less intrusive VPN dialog and other UX tweaks." into lmp-dev
Jeff Davidson   authored and   Android (Google) Code Review   commited 2014-08-20 21:47:20 +00:00
73036b6916
Less intrusive VPN dialog and other UX tweaks.
-The ability to launch VPNs is now sticky; once approved by the user,
further approvals are not needed UNLESS the connection is revoked in
Quick Settings.

-The old persistent notification has been removed in favor of the new
Quick Settings UI.

-The name of the VPN app is now pulled from the label of the VPN
service rather than the app itself, if one is set.

Bug: 12878887
Bug: 16578022
Change-Id: I102a14c05db26ee3aef030cda971e5165f078a91

Jeff Davidson   commited 2014-08-20 16:55:28 -07:00
e038610ff1
Merge "Change CARRIER_SETUP hook in ConnectivityService to use Aeroshell API for determining carrier app instead of MCC/MNC." into lmp-dev
Diego Pontoriero   authored and   Android (Google) Code Review   commited 2014-08-20 21:47:20 +00:00
ae0ba4ba5c
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

Paul Jensen   commited 2014-08-20 19:23:59 +00:00
acea31b3b2
Fix CS/NetworkMonitor race.
If we have a message in flight about a NetworkAgentInfo when it gets disconnected
we are left with a zombie network.  Fixes this by verifing the network is still
live before we process the msg.

bug:17142206
Change-Id: I2c94a39b3ea97c1562066571b277280c1f69f71c

Robert Greenwalt   commited 2014-08-20 09:30:15 -07:00
cf97185784
Fix listening NetworkRequests to listen for all networks.
This is a small change but should fix a number of functional problems:
1. When registering a listening NetworkRequest and when a Network is
   validated, we should always add the listening NetworkRequest to the
   Network's list of NetworkRequests if the Network satisfies the
   NetworkRequest.  Previously in both cases this was only done for
   the highest scoring network.  This enables the listening
   NetworkRequest to listen for all networks, not just the highest
   scoring network.
2. No longer add listening NetworkRequests to mNetworkForRequestId as
   it doesn't make sense as it's a 1:1 mapping but listening
   NetworkRequests to Networks is a many:many mapping.
3. Don't "keep" a Network that's finished validating when only a
   listening NetworkRequest requests it.
4. Don't send updated scores to NetworkFactories from listening
   NetworkRequests.  NetworkFactories and NetworkAgents shouldn't
   concern themselves with listening NetworkRequests.

bug:16680764
Change-Id: Iaba14263227771e4bd84ee4bce488beaef20a8a3

Paul Jensen   commited 2014-08-20 14:46:11 +00:00
3a54e96e43
Fix a logic error so mtu works.
bug:17046179
Change-Id: I744a2fd425627da16d9779df3a96541506e0b6b3

Robert Greenwalt   commited 2014-08-15 17:53:05 -07:00
4b7145b4a7
Configure MTU based on network MTU parameter
Add logic to obtain the mtu from the network PCO parameter and set it to kernel
when the mobile data connection is established. When there is no PCO mtu configured
from the network, the mtu size defined in the corresponding APN will be used. In case
no mtu size is defined for an APN used for data connection, the MCC/MNC based MTU
defined  in the framework overaly will be applied.

bug:17046179
Change-Id: I6465d4b8f2076aaa380ae3617fb3f24adbe136d4

w19976   authored and   Robert Greenwalt   commited 2014-08-14 20:34:13 -07:00
c3455c365a
Don't send NetworkMonitor bcast until systemReady
bug:16913951
Change-Id: I26c5c3353c2d8821452f81765875958d5b9d385b

Robert Greenwalt   commited 2014-08-13 13:43:32 -07:00
61af23aa40
Remove extraneous clearing of inet condition
This was old code I missed in previous inet condition refactor
and caused us to show "not connect" icon any time we connected
to a secondary network (mms/supl/etc).

bug:16896743
Change-Id: I0fa62e09bb0b7c0ee0864bb1f95967eac5f60d3e

Robert Greenwalt   commited 2014-08-12 14:51:48 -07:00
824de8899d
Change CARRIER_SETUP hook in ConnectivityService to use Aeroshell API
for determining carrier app instead of MCC/MNC.

Related ConnectivityService change: http://ag/374479

Related Aeroshell change to SetupWizard: http://ag/520857

Bug: 16457806
Change-Id: I78eb2a25d578400c2de6bae4af3d6e8e1ee4d0c7

Diego Pontoriero   commited 2014-08-12 13:15:20 -07:00
360a42636f
Hack and ship: NetworkStats edition.
Some devices use clatd for catching raw IPv4 traffic when running on
a pure-IPv6 carrier network.  In those situations, the per-UID
stats are accounted against the clat iface, so framework users need
to combine both the "base" and "stacked" iface usage together.

This also means that policy rules (like restricting background data
or battery saver) need to apply to the stacked ifaces.

Finally, we need to massage stats data slightly:

-- Currently xt_qtaguid double-counts the clatd traffic *leaving*
the device; both against the original UID on the clat iface, and
against UID 0 on the final egress interface.

-- All clatd traffic *arriving* at the device is missing the extra
IPv6 packet header overhead when accounted against the final UID.

Bug: 12249687, 15459248, 16296564
Change-Id: I0ee59d96831f52782de7a980e4cce9b061902fff

Jeff Sharkey   commited 2014-08-11 18:40:23 -07:00
b0b27627f5
First pass of changing statusbar connectedness
Switching from GCM-only inet condition reports to using our network
validation (captive portal check).

Note that currently the GCM signal is disconnected.  Next step is to
make the bad-network report API trigger a re-evaluation of the network
and get negative reports from the NetworkMonitor.

Change-Id: Ie2ebab1e5c04775e3c4d6738f656a6c8157dba76

Robert Greenwalt   commited 2014-08-07 22:31:05 +00:00
b264cd8caa
Stop ConnectivityService from talking to netd about uncreated networks.
This avoids logged netd errors that are red-herrings.

bug:16667349
Change-Id: I5d6f1681f1d38dab0af4c535573a0c45c0216603

Paul Jensen   commited 2014-08-07 02:44:51 +00:00
956fa9fd02
Merge "Flush DNS cache when routes change." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-08-06 21:46:55 +00:00
0656b62dde
Flush DNS cache when routes change.
We used to do this but the change got lost in the NetworkAgent
upgrade.  This brings it back.  ConnectivityService has netd do
the actual flushing.

bug:16549455
Change-Id: I11ddd55fcb9d1ed1d2c6a9be7eb8c57e41bdbdb8

Paul Jensen   commited 2014-08-06 22:39:40 -04:00
1b79a59912
Remove dead CaptivePortalTracker.
Captive portals are now detected by the NetworkMonitor.

Change-Id: Ibfb04bf83b1028231397a577468f110d7ab1dc06

Paul Jensen   commited 2014-08-07 02:32:54 +00:00
b5730a6ca8