Commit graph

1,513 commits

Message SHA1
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
Stop using LinkProperties for static configuration.
LinkProperties can represent way more complicated configurations
than what we can actually apply to interfaces. This makes it
error-prone to use it to represent static configuration, both
when trying to apply configuration coming from LinkProperties
and when trying to save configuration from current
LinkProperties.

Instead, move static configuration (IPv4 only, since we don't
support static IPv6 configuration) into a separate
StaticIpConfiguration class.

Bug: 16114392
Bug: 16893413
Change-Id: Ib33f35c004e30b6067bb20235ffa43c247d174df

Lorenzo Colitti   commited 2014-08-19 11:59:43 -07:00
58d028a9dc
Add tcp buffer size conduit to NetworkAgent.
bug: 16549611
Change-Id: I7d97dedea2c7c1aed2eccb185645889424508591

Robert Greenwalt   commited 2014-08-17 15:14:29 -07:00
0380686903
Fix a logic error so mtu works.
bug:17046179
Change-Id: I744a2fd425627da16d9779df3a96541506e0b6b3

Robert Greenwalt   commited 2014-08-15 17:53:05 -07:00
4b7145b4a7
Merge "Configure MTU based on network MTU parameter" into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-15 19:10:34 +00:00
b89454ddc0
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
Some networks may have null ifaces, I guess?
Seems like a bug further upstream, but guard ourselves against it
for now.

Bug: 17033841
Change-Id: Id0e5895c3389b63d4e34b1fb064efef8b72cd609

Jeff Sharkey   commited 2014-08-14 22:42:27 +00:00
3318b056eb
Made AlarmClockInfo a nested class in AlarmManager
Bug: 16959028
Change-Id: I150eaaff765d1e214c3621c1bf50162ec0dac8ec

Jose Lima   authored and   Jose Ricardo Lima   commited 2014-08-14 02:10:41 +00:00
765b3ba313
Merge "Don't send NetworkMonitor bcast until systemReady" into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-08-13 23:16:37 +00:00
1d40f06ebe
Don't send NetworkMonitor bcast until systemReady
bug:16913951
Change-Id: I26c5c3353c2d8821452f81765875958d5b9d385b

Robert Greenwalt   commited 2014-08-13 13:43:32 -07:00
61af23aa40
Switch RouteInfo to use IpPrefix instead of LinkAddress.
This addresses a TODO and also makes it possible to create
routes to destinations that are not valid LinkAddresses, such as
multicast addresses.

Bug: 16875580
Change-Id: Id4c77b00dc3064bf27d78cdcbbe035e645748cfe

Lorenzo Colitti   commited 2014-08-13 21:17:20 +09:00
4a0ff0272c
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
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
Merge "Add logging of Legacy Type info." into lmp-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-07-24 16:04:26 +00:00
28f422506a
Fix docs build.
Change-Id: I3be4c5b74e85d2491316986d8c3c0575cd01a8fc

Dan Sandler   commited 2014-07-31 02:27:52 -04:00
c4bc59b0b3
Allow using third-party HTTP/... stacks for per-network URLs.
Also switch to double-checked locking for
mNetworkBoundSocketFactory and OkHttpClient.

Change-Id: Ic52776ee760036ad5623b7496156b8909dc282fa

Lorenzo Colitti   commited 2014-07-31 02:17:28 +00:00
789d7c2cce
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
Use a new socket for each of the host's IP addresses.
If Socket.connect() times out, the socket cannot be used any
more - any attempt to do so fails with EBADF. Use a new
socket for each IP address.

Bug: 16664129
Change-Id: If3616df86f7c2da0eabd30dca5db65d0da85cb17

Lorenzo Colitti   authored and   Paul Jensen   commited 2014-07-30 17:31:04 +00:00
10d9ba56d9
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
Add a getBoundURL method that returns a network-specific URL.
Change-Id: I4b57e675bb87064ab75dcc36b00fdc7a2987b86e

Lorenzo Colitti   commited 2014-07-28 16:16:58 +00:00
53a2a7573b
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
Infer legacy network type for ConnectivityManager.requestNetwork
ConnectivityManager.requestNetwork pass TYPE_NONE to
sendRequestForNetwork which prevents it from being used with legacy API
requestRouteToHostAddress. This CL infers the legacy network type
automatically from the network capabilities.

b/16324360

Change-Id: I591d38f875f42f56e8cfc157db2069c9eee0ee26

Ye Wen   commited 2014-07-23 11:41:17 -07:00
849c72a71d
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
Readjust location of NETID_UNSET definition.
This is a tweak to my 8ec11bb change I a-little-too-hastily committed.

Change-Id: Ibeee9382109994c66227d1c42aac749e2a274ed7

Paul Jensen   commited 2014-07-11 16:53:39 +00:00
0478ace923
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
am 81c92451: Allow overlays to configure ConnectivityService\'s network sampling to not wake the device. This can increase clockwork device battery life. Bug:15455204
* commit '81c9245195':
  Allow overlays to configure ConnectivityService's network sampling to not wake the device. This can increase clockwork device battery life. Bug:15455204

Aaron Whyte   authored and   Android Git Automerger   commited 2014-07-11 01:46:08 +00:00
6ea0082bdf
Missed an entry in the copy constructor.
bug:15755597
Change-Id: Iee17ca88404a6a50258d204a12cd0c04cd15e34e

Robert Greenwalt   commited 2014-07-10 14:55:14 -07:00
612302f666
Allow overlays to configure ConnectivityService's network sampling to not wake the device.
This can increase clockwork device battery life.
Bug:15455204

Change-Id: Ifc551e6a522627dc8e5cfdfb8f56d4e3cbeea936

Aaron Whyte   commited 2014-07-10 14:05:35 -07:00
81c9245195