Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
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
e714f1daa6
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
435565dd96
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
0aef9341d3
Fix docs build.
Change-Id: I3be4c5b74e85d2491316986d8c3c0575cd01a8fc

Dan Sandler   commited 2014-07-31 02:27:52 -04:00
3d2c4da534
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
8d20c50093
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
54a8d4c170
Allow VPNs to add/remove link addresses dynamically.
Bug: 15409819
Change-Id: If91fc6891d7ce04060362c6cde8c57462394c4e8

Sreeram Ramachandran   commited 2014-07-29 00:32:59 +00:00
e458632059
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
73b0009b50
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
6ba91ae8a0
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
c36a74f2a6
Add a getBoundURL method that returns a network-specific URL.
Change-Id: I4b57e675bb87064ab75dcc36b00fdc7a2987b86e

Lorenzo Colitti   commited 2014-07-28 16:16:58 +00:00
b9ab4282cf
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
3518e37286
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
abbc41e859
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
ca7ababe8b
Cleanup: Delete dead code.
Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc

Sreeram Ramachandran   commited 2014-07-22 15:46:34 -07:00
c06ec73149
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
b5ae69d410
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
5dea435dd4
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
65743a26ad
Missed an entry in the copy constructor.
bug:15755597
Change-Id: Iee17ca88404a6a50258d204a12cd0c04cd15e34e

Robert Greenwalt   commited 2014-07-10 14:55:14 -07:00
bd7397eb5b
Add networkSpecifier string to NetworkCapabilties.
Allows transport specific network selectivity where multi-sim or sta+sta
is supported.

bug:1575597
Change-Id: I9c60fe7710e988c17d63236788b492a3ddd264a1

Robert Greenwalt   commited 2014-07-10 20:58:20 +00:00
a6bc0916e7
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

Paul Jensen   commited 2014-07-10 20:39:33 +00:00
8b5fc62d12
Merge "Refactor wifi p2p's startDhcpServer function"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-07-10 18:27:37 +00:00
1166831856
Refactor wifi p2p's startDhcpServer function
Add getTetheredDhcpRanges() interface and call it before calling
mNwService.startTethering to update dhcp ranges.  This will allow
p2p apps to run well concurently with other tethering apps.

Manual import of AOSP change 81546 by jianzheng.zhou@freescale.com

Change-Id: Iebc62f95bdcedde80e2c1d3e9580d3f625c3b50b

Robert Greenwalt   commited 2014-07-10 18:56:12 +00:00
e594a76c9f
Add Network inspection API.
Adds getNetworksNetworkInfo.
Adds getAllNetworks.

Cleans up some synchronization issues.

Change-Id: I82c7a4b554e3c6c1adfe6027cc54b028ed6dbac9

Robert Greenwalt   commited 2014-07-10 10:48:23 -07:00
02fe11eba3
Add Trust to NetworkCapabilities.
Indicates the user has indicated implicit trust of a network.  This
generally means it's a sim-selected carrier, a plugged in ethernet,
a paired BT device or a wifi they've asked to connect to.  Untrusted
networks are probably limited to unknown wifi AP.

Change-Id: I89490bdaa3c2d63d33f876c72d8b088dc155fa3d

Robert Greenwalt   commited 2014-07-08 23:55:18 +00:00
a134636a4b
Remove dead code.
Also adds a TYPE_VPN so the VPN can be strongly typed.

Change-Id: Ibf39450c480f16ce5ab4c25b47965691b844fb92

Robert Greenwalt   commited 2014-07-07 17:09:01 -07:00
ce7a144472
Merge "Remove unused api."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-07-02 18:55:10 +00:00
f7c7336625
Fix build
Change-Id: I7d0787e4a1f778008c979c4174ef445a950c4250

Glenn Kasten   commited 2014-07-07 07:12:29 -07:00
b20d886bce
Remove unused api.
bug:15595155
Change-Id: Ifd79365bd45f20f531782244f471a4cfc32a4135

Robert Greenwalt   commited 2014-07-02 13:50:33 -07:00
e0b0051472
Add captive portal sign-in actions.
Change-Id: I70a6c2efc4f3fa48d5b65e8d630682fe74abfe2c

Paul Jensen   commited 2014-07-02 16:47:48 +00:00
e378679df9
Make sure callback handler is in place before callbacks handled.
When making Network requests in ConnectivityManager, make sure we install the
callback prior to a response from ConnectivityService arriving causing us to
search for the callback and inadvertently not find it.

bug:15928097
Change-Id: Ie5feb9cc8f5effc19870f54dba07218b2e11d82a

Paul Jensen   commited 2014-07-02 13:50:53 +00:00
bb427685db
MS: Adding Support for Emergency APN in Telephony Framework
(base/telephony)

Replacement for https://partner-android-review.googlesource.com/#/c/171175/

Change-Id: I16fc37f5c00ed79f2370bc46554fc7a24c52c4cb
Conflicts:
	core/java/android/net/ConnectivityManager.java

Ram   authored and   Etan Cohen   commited 2014-07-01 02:00:51 +00:00
693d07a0b4
Use return values from JNI functions binding sockets and processes to networks.
bug:15757549
Change-Id: If23b14febc923b9a0348f0cf9029fd4bf6e8d725

Paul Jensen   commited 2014-06-26 16:33:58 +00:00
10ba60a4a1
Modify DNS server update methods.
1. Make addDnsServer not add duplicate servers and return a
   boolean value incating whether it changed anything. This is
   consistent with what we do for LinkAddresses and routes.
2. Add a setDnsServers method that sets all the DNS servers to
   the specified collection. This is consistent with what we do
   for LinkAddress.

Bug: 9180552
Change-Id: I5baed09253261b66ea42ae2ea82398118e3ab0ac

Lorenzo Colitti   commited 2014-06-26 17:04:38 +09:00
131eb31373
Teach LinkProperties whether it's provisioned or not.
In IPv4, a link is provisioned when DHCP succeeds. In IPv6, a
there is no such signal, because addresses and DNS servers can
be notified by the kernel at different times.

Add an isProvisioned method that returns true if we believe that
enough information has configured to use a network. For IPv6,
this requires an IP address, default route, and DNS server. For
IPv4, this requires only an IPv4 address, because we support
static configuration that doesn't have a default route or DNS
server.

To do this we use the existing hasIPv4Address method, rename the
all-but unused hasIPv6Address method to hasGlobalIPv6Address
(which is what we want anyway) and add new hasIPv[46]DefaultRoute
and hasIPv[46]DnsServer methods.

Bug: 9180552
Change-Id: Ib2f5ff8af920f7b6f1edf0e2afaaa0edce9bc72d

Lorenzo Colitti   commited 2014-06-26 03:23:31 +09:00
fc854695c1
Minor changes to RouteInfo.
1. Realize that mDestination can never be null and update the
   code accordingly.
2. Simplify isDefaultRoute.
3. Provide two new hidden utility methods, isIPv4Default() and
   isIPv6Default(), that can be used by LinkProperties to
   to determine if the system has connectivity.
4. Update tests.

Bug: 9180552
Change-Id: I85028d50556c888261d250925962bdedfe08e0c6

Lorenzo Colitti   commited 2014-06-25 18:22:12 +00:00
99064fa3ae
Clean up and add some Network logging.
Dumps the netid for the Network and adds that to the NetworkAgentInfo.

Change-Id: Id9fbcc55ca55bf1a020f747f0c44902efb1b5f87

Robert Greenwalt   commited 2014-06-23 17:40:12 -07:00
52228dd7cf
Merge "Add logging to track down weird ConnectivityManager issue."
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-23 21:44:43 +00:00
7ee7824678
Add logging to track down weird ConnectivityManager issue.
bug:15771399
Change-Id: I0a7150286f94262414005298e6f038f278347a7c

Robert Greenwalt   commited 2014-06-23 15:33:40 -07:00
b8401730a8
Modify LinkProperties add/remove route functions.
This will allow us to dynamically track routes being added and
removed, similar to what we do for IP addresses.

1. Support removing routes. Since this is a new function, we
   don't need to jump through hoops to support callers passing
   in routes that have no interface, we just fail to match them.
2. Make the addRoute method return a boolean value indicating
   whether anything changed. This is consistent with what we do
   for addresses and is used to decide whether to update the
   rest of the system when an update comes in.

Bug: 9180552
Change-Id: I50648b5f81ec55c88501a7640e119cda2bb540f2

Lorenzo Colitti   commited 2014-06-17 11:18:53 +09:00
36ddd9d00c
IpPrefix improvements.
1. Allow IpPrefixes to be created from strings. In order to do
   this, factor out the code from LinkAddress which already does
   this to a small utility class in NetworkUtils.
2. Truncate prefixes on creation, fixing a TODO.
3. Add a toString method.
4. Write a unit test.

While I'm at it, make RouteInfoTest pass again, and convert it
to use IpPrefix instead of LinkAddress.

Change-Id: I5f68f8af8f4aedb25afaee00e05369f01e82a70b

Lorenzo Colitti   commited 2014-06-17 11:18:53 +09:00
174bab2a0d
Merge "Fix build"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-12 05:34:42 +00:00
f72c856009
Fix build
Re-finalizing some classes.  The api/current.txt was updated separately but the change
that made them final got skipped.  Also had same issue for some @hide's that were removed.

Change-Id: I423bb7b3029ee03425a3c446bda51ab8191887c1

Robert Greenwalt   commited 2014-06-12 16:24:38 -07:00
c4920a555d
am 2d0ab42b: Merge "Apply API Council comments to ConnectivityManager" into lmp-preview-dev
* commit '2d0ab42b1420db884d26fd2ef22710b5a887e9a6':
  Apply API Council comments to ConnectivityManager

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 22:31:07 +00:00
6f033963ff
Apply API Council comments to ConnectivityManager
rename isNetworkActive -> isDefaultNetworkActive
rename registerNetworkActiveListener -> registerDefaultNetworkActiveListener
make listenForNetwork/requestNetwork take a NetworkRequest
rename NetworkCallbackListener -> NetworkCallback
rename listenForNetwork -> registerNetworkCallback
rename releaseNetworkRequest -> unregisterNetworkCallback
remove NetworkRequest param from NetworkCallback functions
rename onNetworkCapabilitiesChagned to onCapabilitiesChanged
remove onReleased
change time units in onLosing from Sec -> ms

bug: 15142362
Change-Id: Ibc96e3f461706efe1eafa0d85605249cfd6e9fdd

Robert Greenwalt   commited 2014-06-11 23:17:46 -07:00
f57c03c3b9
Make IpPrefix final.
Couldn't resolve a merge conflict, so skipped and make the change this way.

Change-Id: Ib043f660fca2090f0d12a5a707e5e1ad28f76adb

Robert Greenwalt   commited 2014-06-12 12:57:19 -07:00
4998e952f8
am 558aeb90: Merge "Make NetworkCapabilities publicly immutable." into lmp-preview-dev
* commit '558aeb901144fac460575402e38fc8baa2da83eb':
  Make NetworkCapabilities publicly immutable.

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-06-12 18:49:07 +00:00
bb0ec47862
Make NetworkCapabilities publicly immutable.
Applying API council comments.

bug: 15142362

(cherry picked from commit Ie0bde68b72656a676d90c0343b9756fe9268d8d6)
Change-Id: Ie0bde68b72656a676d90c0343b9756fe9268d8d6

Robert Greenwalt   commited 2014-06-11 23:29:39 +00:00
bfd1f4c206
Fix wifi connectivity issues.
http://ag/480881 changed RouteInfo.getDestination() to return an IpPrefix
instead of a LinkAddress. This makes the equals() comparison always fail.

So, when ConnectivityService.updateRoutes() is given identical routes, instead
of realizing that there's no diff, it would consider them different, and thus
add and remove the same route. The add would fail, since the route already
existed in netd, but the remove would succeed, leaving the system with no routes
and thus no connectivity.

Bug: 15564210
Change-Id: I2003b0fcb809cc20837dc489c58af37891ca4556

Sreeram Ramachandran   commited 2014-06-11 15:56:51 -07:00
96151d642e
Merge "Fix wifi connectivity issues." into lmp-preview-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-06-11 21:23:31 +00:00
08bbe1fd33