Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Also include the domain when parceling StaticIpConfiguration.
StaticIpConfiguration objects are parceled at least as part of the
IpConfiguration objects that are passed to IEthernetManager when an
application sets static IP configuration on Ethernet.

Change-Id: I49991e2f591cc6cf01b503c18eb343b5929efe29

Lorenzo Colitti   commited 2015-01-29 12:20:55 +00:00
68a1a34ec0
Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()
setDomain() and toLinkProperties() were not setting the domains.
The setDomain() bug affected Wifi and I believe the toLinkProperties()
bug affected Ethernet and Bluetooth reverse-tethering.

(cherry picked from commit c53113b37f33c7ed19660c8ec5bfd578e8bb5409)

bug:18252947
Change-Id: I6235fcd6b875aee516efbb5f880db1a99380355b

Paul Jensen   authored and   Lorenzo Colitti   commited 2015-01-29 17:12:35 +09:00
99366a8aa4
Support connecting to networks with misconfigured subnet masks.
In K and earlier, we would connect to a network where the gateway
was not covered by the subnet mask of the IP address. This is an
invalid configuration, but it used to work, and other OSes appear
to accept it too, so support it.

Bug: 19067207

(cherry picked from commit 2dfb79a54adeb4bcf1f62332a9db467fce302ced)

Change-Id: I80088f291466dbd5a47f360dcc1620acee5cf57e

Lorenzo Colitti   commited 2015-01-28 20:36:37 +09:00
c915d4c83d
Changes associated with an OkHttp upgrade
Change-Id: I2a4db602aa7ffdef886e0f1a955715a2551a87a5

Neil Fuller   commited 2015-01-20 11:59:24 +00:00
c30362d9cf
Send callbacks for Net property changes
LinkProperties and NetworkCapabilities changes were not calling app callbacks.

bug:17681483
Change-Id: I67dac3c4dc1284f5c4bfb24de239da4ec776336f

Robert Greenwalt   commited 2014-10-02 21:05:44 -07:00
e525a0a7f7
Move mobile provisioning APN support into telephony.
Most of this logic is simply removed from ConnectivityService.
The captive portal detection is now done by the NetworkMonitor.
The notification logic is still left in ConnectivityService as
it's used by both the NetworkMonitor and telephony's mobile
provisioning logic.

bug:17324098

Change-Id: Ibd1c42b1a75795f90a6483d3d0a5a14f88b193d8

Paul Jensen   commited 2014-09-29 11:37:43 +00:00
ebeaecde71
Block address families with routes, not NetworkAgent side channel
Now that we support unreachable routes, use those to block
address families on VPNs. This is a much more elegant solution.
Also update LinkProperties when IP addresses are added and
removed, fixing a TODO.

Bug: 17462989
Change-Id: Ib749d84710dca70d672350b9f129bb91419ec77e

Lorenzo Colitti   commited 2014-09-23 10:48:28 +09:00
83d12dbbb7
Support non-unicast route types: unreachable and throw.
Bug: 17462989
Change-Id: I8635472ca3e96ec2866af2de48e6260ab2da13fb

Lorenzo Colitti   commited 2014-09-22 13:10:15 +09:00
2129034e25
Merge "Use unified Tethering Permission Check" into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-09-18 00:02:16 +00:00
61b67c71c5
Use unified Tethering Permission Check
The BT and Wifi mechanisms for enabling Tethering did their own
permission checks.  This set of changes unifies the check into
a ConnectivityManager function so they can be kept in sync.

bug:17435527
Change-Id: I8c157a5acf56ffbddd349cb6a45160ae7be8541b

Robert Greenwalt   commited 2014-09-17 16:18:12 -07:00
3c5dee0a26
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
e06ea4b12f
Merge "Report Network status to NetworkAgent." into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-09-16 22:59:33 +00:00
a652f2a6c5
Fix a typo in comment.
Change-Id: I23224b1adf946ebec0ec7a39686913189c9b8287

Ang Li   commited 2014-09-15 15:09:16 -07:00
9d294201bf
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
2dce6d63dc
Merge "Flush HTTP socket pools and DNS cache when binding process to a Network." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-09-11 13:15:22 +00:00
4fb6fe5260
Make Network.openConnection() share HttpHandlers not OkHttpClients.
HttpHandler and HttpsHandler classes have a lot of bug fixes baked into
them that the Network.openConnection() API should be using, for example
disabling SPDY support.

bug:17420465
Change-Id: I9f1472753a542d1dd6bffde3a60c37a9145098aa

Paul Jensen   commited 2014-09-11 00:25:50 +00:00
7c60bc2a70
Flush HTTP socket pools and DNS cache when binding process to a Network.
Future HTTP requests could use an old socket that's bound to a different Network
causing unexpected results.  DNS results could also not be appropriate.

bug:17283566
bug:17432215
Change-Id: I88b40b723c7b442000cafe8ce8b9d989d8995991

Paul Jensen   commited 2014-09-10 18:26:25 +00:00
3e2917cd71
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
31475db1a4
Fix networking API per scripting checks.
bug:17389242
Change-Id: I6017f559788ee16a1721b387796e5bda5e07280d

Robert Greenwalt   commited 2014-09-04 16:50:29 -07:00
ad35b13305
Merge "Catch creation of NetworkRequest without NetCap" into lmp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-09-04 21:08:11 +00:00
949b25423e
Proxy fixes from API review feedback
Bug: 17389383
Change-Id: Ib5e40f55d02687ee917ba30773123cf3e4c2a97d

Jason Monk   commited 2014-09-04 15:39:56 -04:00
f098cfcbbe
Catch creation of NetworkRequest without NetCap
Using reflection you could do this and it would crash the system.
Thanks, ServiceFuzzer!

bug:17379629
Change-Id: I8b470bda78a69761ccd92496746f5d295b5d07f2

Robert Greenwalt   commited 2014-09-03 20:57:41 -07:00
ea266c65ee
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
939112e006
Use per-Network connection pools for openConnection.
If we don't do this, per-network HTTP requests will go over the
wrong network if any previous HTTP request was made by the same
app on another network.

Bug: 17300006
Change-Id: I1854c16dee6adb9e81fb12b097577439d69a644e

Lorenzo Colitti   commited 2014-08-29 18:13:19 -07:00
d092cb50d3
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
860a7aa21a
Clean up Connectivity Logging.
bug:17285109
Change-Id: I61b98aa636996f8d4915fd954d49a22c20cfe9ab

Robert Greenwalt   commited 2014-08-27 14:49:14 -07:00
419e1b4362
Merge "Remove captive portal sign-in actions." into lmp-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-08-25 18:52:32 +00:00
becb073b12
Remove captive portal sign-in actions.
This reverts commit e0101cd and removes the related NetworkMonitor code.
The thinking is the broadcasts are not robust enough as they rely on apps
working together and are not sufficiently tested.

bug:17115050
Change-Id: I433032867cc4fea7191a1b13842b16825dc74df4

Paul Jensen   commited 2014-08-22 09:42:56 -04:00
af9351f884
Rework the per-network URL API.
This addresses API council comments.

Bug: 17112978
Change-Id: I698b243b2b685d1f25414cee72450be3ae0c2bf0

Lorenzo Colitti   commited 2014-08-21 19:09:27 -07:00
45aca20cd7
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
6047c1dc68
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
ef734f8a3b
Add tcp buffer size conduit to NetworkAgent.
bug: 16549611
Change-Id: I7d97dedea2c7c1aed2eccb185645889424508591

Robert Greenwalt   commited 2014-08-17 15:14:29 -07:00
debf0e0075
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
36a05df3f3
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
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
f2ceed8a54
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