Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
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
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
Add Logging around getNetworkInfo.
bug:16610051
Change-Id: I04f19efc99bce6d990364291b6cd8105f08ab263

Robert Greenwalt   commited 2014-08-02 00:15:41 +00:00
d8b18ff04e
Improve LegacyTypeTracker.
Keep track of requests as well as of networks that come and go.
This is necessary, for example, to ensure that we pretend that
HIPRI has gone down when the HIPRI request goes away, even
though the underlying cell network is actually completely
unaffected.

Also, ensure that when switching default networks we send
disconnect broadcasts (and do so *before* connect broadcasts, to
maintain the illusion).

Bug: 16610051
Change-Id: Ib3c831387124940156df05b312cc36bc0724373e

Lorenzo Colitti   authored and   Robert Greenwalt   commited 2014-08-01 23:52:04 +00:00
d55162bcda
Add logging of Legacy Type info.
There are some bugs where getActiveNetworkInfo gives bad data (seemingly)
and this will give the backing data in logs.

bug:16610051
Change-Id: Iad867485ad78daeb3e88665dcd0fdb0af756a3bf

Robert Greenwalt   commited 2014-07-30 16:31:24 -07:00
dbd5f316b7
Remove dead code 4.
Removing:
handleDnsConfigurationChange
updateDnsLocked
updateRoutes
handleConnectivityChange
handleConnect
handleDisconnect

Adding a missing flushVmDnsCache and setting of mActiveDefaultNetwork

Change-Id: I681fc72c317833ea1deb42db0b43d2adb21baeff

Robert Greenwalt   commited 2014-07-29 16:32:08 +00:00
f96275d333
Remove dead code 3.
Removing mNetRequestersPids and mPriorityList.

Change-Id: I8295040436b62f7f6495ece7154246fb719288a4

Robert Greenwalt   commited 2014-07-29 00:36:38 +00:00
db6200ee05
Allow VPNs to add/remove link addresses dynamically.
Bug: 15409819
Change-Id: If91fc6891d7ce04060362c6cde8c57462394c4e8

Sreeram Ramachandran   commited 2014-07-29 00:32:59 +00:00
1892fa5da9
Remove dead code 2.
Removing ConnectivityService.NetworkFactory.  This requires disabling
the ConnectivityServiceTest, but that's been broken since we stopped
using NetworkStateTrackers anyway.

Change-Id: I9b86bd37eb9d018c40f60dca5b00d62c36d4e3ad

Robert Greenwalt   commited 2014-07-28 14:48:52 -07:00
39bb79b986
Merge "Remove dead code 1." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-07-24 20:48:02 +00:00
8ef2e0c04d
Prohibit address families by default unless a VPN explicitly allows them.
Bug: 15972465
Change-Id: I3278d94536fefacc86390c1ba4231680f7be8589

Sreeram Ramachandran   commited 2014-07-28 18:52:41 +00:00
0bb9c07eba
Remove dead code 1.
Starting with startUsingNetworkFeature and stop.
Figure it's easier to code review incremental changes.

Change-Id: I19aee65e740858c3a9a2a1a785663f6fee094334

Robert Greenwalt   commited 2014-07-28 11:34:36 -07:00
bf23e031f7
Move Alarm setup to systemReady.
Don't register alarms before the system is ready.

bug:16484913
Change-Id: Iae5c75ff8d40d4d39dbb23ff65a600b4a00cd1f0

Robert Greenwalt   commited 2014-07-27 12:30:51 -07:00
2f58b8d122
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

Sreeram Ramachandran   commited 2014-07-25 15:17:23 -07:00
cf57204573
Fix DUN-based tethering.
It was calling into dead ConnectivityService code rather than using
the new ConnectivityManager shim code.

bug:15221541
Change-Id: I1e3eea8a658a162ce36673ed1cf7b1e7e4372c42

Robert Greenwalt   commited 2014-07-24 14:39:51 -07:00
a795e822a0
Reenable logging.
ConnectivityService has been rewritten for L and is in a stabilizing period.
We need the logging to track down bugs people report.
Restoring to Pre-L conditions.

If there's excess logging please report it - it probably indicates a bug.

Change-Id: I7baf891e3bf12e1545afeb92b8d5af0b01e12a7b

Robert Greenwalt   commited 2014-07-23 12:42:47 -07:00
d5b65ffa48
Cleanup: Delete dead code.
Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc

Sreeram Ramachandran   commited 2014-07-22 15:46:34 -07:00
c05e2a9093
Updated media browsing API & tests.
Change-Id: I3a1e3eead99a98b1890e05843dd90203cee517b7

Yao Chen   commited 2014-07-21 21:14:43 -07:00
9ef577bfba
Make a network the default when it connects if we have no default.
When a network comes online, is a candidate for being the default network
(i.e. satisfies default NetworkRequest), and the device has no default
network, then make the new network the default network for the purposes
of routing network traffic.  This does not affect NetworkRequests or
NetworkCallbacks.  This ignores but does not affect network validation.

Benefits:
1. Offers a fail-safe in case network validation returns a false negative.
   For example:  It would be nice if every Android device didn't fail when
   clients3.google.com/generate_204 went down.
2. Offers a method to debug connectivity issues.
   For example:  If WiFi is failing, disabling Cellular would rule out
   interference from WiFi network validation.
3. Reduces delay between no connectivity and any connectivity.
4. Offers a fail-safe in cases of unreliable networks.
   For example: You need rescuing from a remote location with a weak signal
   offering 90% packet loss.  You just want your distress call to go out
   but are infuriated to find network validation blocks connectivity.

Change-Id: I78621a1fe8ed2a336591f65bf7b07a6cbcc7ba5e

Paul Jensen   authored and   Robert Greenwalt   commited 2014-07-16 16:12:16 -07:00
207feb7db3
Fix hiding of sign-in to network notification.
Don't rely on the NetworkAgent still being connected when we go to
hide the notification.  The notification is hidden when the
NetworkAgent is disconnected so that wasn't a safe assumption.
By using the NetID as the notification identifier we also fix the
issue of multiple notifications of the same network type inadvertently
hiding the incorrect notification with the same network type.

bug:16317917
Change-Id: I01fdc466a0f430af9fc378445586ec7b83b3ac83

Paul Jensen   commited 2014-07-15 19:06:39 +00:00
8ba5ffb9a5
Remove unnecessary code and APIs.
This stuff has been replaced by setNetworkForUser() in NetdClient.

Change-Id: If525ee259b74314191d1913f7c2a3e828e05c38f

Sreeram Ramachandran   commited 2014-07-11 18:16:04 -07:00
7085a7a920
resolved conflicts for merge of 6ea0082b to master
Change-Id: I8ec28728c12d7cc3ce2c4f3d09d9ce6162504618

Aaron Whyte   commited 2014-07-11 13:34:41 -07:00
37e24d93b5
Define NETID_UNSET in ConnectivityManager.
This allows some cleanup and removal of dead code.

bug:15489928
Change-Id: Iaf0507bc2e8ec6dcc253f01f61c5b221d46581f9

Paul Jensen   commited 2014-07-11 12:00:10 -04:00
8b6260fba5