Commit graph android_packages_modules_Co.../core/java
Message SHA1
Merge "Map TYPE_VPN integer to "VPN" string."
Erik Kline   authored and   Android (Google) Code Review   commited 2014-11-25 18:46:37 +00:00
ec6a80208e
Map TYPE_VPN integer to "VPN" string.
Bug: 18439110
Change-Id: I0fa0c9e6a9293ab724e2b5e7d0f586f05cd100c7

Erik Kline   commited 2014-11-25 13:16:58 +09:00
137fadcd4c
Merge "Delete unused/non-working code." into lmp-mr1-dev
Sreeram Ramachandran   authored and   Android (Google) Code Review   commited 2014-11-24 17:24:26 +00:00
04f46a029e
Allow VPNs to specify their underlying networks.
These are used when responding to getActiveNetworkInfo() (and cousins)
when an app is subject to the VPN.

Bug: 17460017
Change-Id: Ief7a840c760777a41d3358aa6b8e4cdd99c29f24

Sreeram Ramachandran   commited 2014-11-21 09:26:18 -08:00
d2b4fe2b2d
Delete unused/non-working code.
Change-Id: I2cba9ffdb4ed547cb922d0ac08abf81e49ffa66b

Sreeram Ramachandran   commited 2014-11-21 08:08:19 -08:00
541254ae51
Eliminate race conditions in UID-based network filtering.
The previous code retrieved information from the legacy tracker multiple
times for each user query, leading to race conditions where the info
could've changed between the calls.

Refactors the handling of legacy data types in ConnectivityService and
unifies call paths so that APIs that deal with legacy data types
(NetworkInfo and int/networkType) and newer types (such as Network) go
through common code paths, using NetworkState to hold all the necessary
data pieces. This enables follow-on bug fixes to getActiveNetworkInfo().

The changes are limited to public "query" APIs (those that retrieve some
network information or the other). More details about the specific
changes and their rationale can be found in the code review thread.

Bug: 17460017
Change-Id: I656ee7eddf2b8cace5627036452bb5748043406c

Sreeram Ramachandran   commited 2014-11-21 08:07:13 -08:00
7c9871648e
Rename EXTRA_NETWORK ConnectivityManager constants.
Per b/18414703:

    s/\<EXTRA_NETWORK_REQUEST_NETWORK\>/EXTRA_NETWORK/g
    s/\<EXTRA_NETWORK_REQUEST_NETWORK_REQUEST\>/EXTRA_NETWORK_REQUEST/g

Additionally, associated string values updated to:

    android.net.extra.NETWORK
    android.net.extra.NETWORK_REQUEST

Bug: 18414703
Change-Id: I7aeed2161829742affc666e835a97ce2c28356fe

Erik Kline   commited 2014-11-20 13:16:31 +09:00
8a82621cdb
Implemented requestNetwork with a PendingIntent.
ConnectivityManager.requestNetwork(NetworkRequest, PendingIntent)
was unhidden and implemented.

Added ConnectivityManager.removePendingIntentRequest(PendingIntent) as
the companion method.

Bug: 17356414
Change-Id: I656a1e149cc1292c443ebfe9e61ee3eb5a80f143

Jeremy Joslin   commited 2014-11-06 11:43:27 -08:00
60d379b618
Merge "Fix Legacy typing of net-specific requests." into lmp-mr1-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2014-11-05 23:36:01 +00:00
08881e11cf
Fix Legacy typing of net-specific requests.
We're starting to get network requests for specific SIMs
and the Legacy Type Inference was broken because the incoming
request included a network specifier while the legacy requests
it was compared with did not.  Only compare the things we care
about.

bug:18031008
Change-Id: If107042828c152ede51a2497a3859bc1a6c83694

Robert Greenwalt   commited 2014-11-05 15:06:20 -08:00
08c7c9803c
Merge "Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()" into lmp-mr1-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-11-05 19:05:09 +00:00
821255f29e
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.

bug:18252947
Change-Id: I8764cb944c293e01d99822bb52b55af7e9d77853

Paul Jensen   commited 2014-11-05 09:35:26 -05:00
aadf9b78b4
Treat optimistic addresses as global preferred.
If the kernel sends notification of an optimistic address then
treat is a useable address (isGlobalPreferred()).

Note that addresses flagged as IFA_F_OPTIMISTIC are
simultaneously flagged as IFA_F_TENTATIVE (when the tentative
state has cleared either DAD has succeeded or failed, and both
flags are cleared regardless).

Additionally: do not consider RFC 4193 ULA addresses sufficient
for "global preffered".  They are, by definition, of global scope
but not sufficient for global reachability.

Bug: 17769720
Change-Id: I759623b28fd52758f2d4d76d167f3cafd9319d6a

Erik Kline   commited 2014-10-29 19:11:58 +09:00
143e89c2f1
Merge "(re)define the definition of "provisioned"" into lmp-mr1-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2014-10-28 07:53:37 +00:00
a7691fcb44
Merge "Change removeStackedLink to take an interface name." into lmp-mr1-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-10-28 07:00:31 +00:00
846ae01231
Change removeStackedLink to take an interface name.
This simplifies callers.

Also remove all "implementations" of addStackedLink and
removeStackedLink except the one in LinkProperties, because they
are unused.

Bug: 12111730
Change-Id: Ie294b855facba4b1436299dcb3211b72d9ba448e

Lorenzo Colitti   commited 2014-10-28 15:13:57 +09:00
3825843c73
(re)define the definition of "provisioned"
Specifically:

    [1] provide a hasIPv4(), and
    [2] a hasIPv6()

each of which requires an IP address, a default route, and
address-family-specific DNS servers to evaluate to true.

Additionally:

    [3] redefine isProvisioned() to return the logical OR
        of [1] and [2] above.

Any external caller can still use any of the has*() methods to
construct its own, different definition of "provisioned".

Bug: 17769720
Change-Id: Ia692fb8508484ff403d3920c94d0e1db4563f807

Erik Kline   commited 2014-10-28 14:47:42 +09:00
8b02307fd5
Merge "Deprecate more apache-http." into lmp-mr1-dev
Narayan Kamath   authored and   Android (Google) Code Review   commited 2014-10-24 08:58:45 +00:00
923d9a405c
Deprecate more apache-http.
bug: 18067888

Change-Id: I50511d53dfc9ae236dfb1646c55a5dd7fa15d7b2

Narayan Kamath   commited 2014-10-23 17:43:05 +01:00
38c2dc3b49
Add an API to select a network for a DatagramSocket.
Mirrors the API that does this for Sockets.

Bug: 18076907
Change-Id: Ifa27b39e23797558546aab751fbfb3aed3b7dbcb

Sreeram Ramachandran   commited 2014-10-23 08:37:33 -07:00
76a545ffc4
am 707d0288: Merge "Send callbacks for Net property changes" into lmp-dev
* commit '707d028804':
  Send callbacks for Net property changes

Robert Greenwalt   authored and   Android Git Automerger   commited 2014-10-03 15:41:04 +00:00
db4908dc1c
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
am ebeaecde: Move mobile provisioning APN support into telephony.
* commit 'ebeaecde71':
  Move mobile provisioning APN support into telephony.

Paul Jensen   authored and   Android Git Automerger   commited 2014-09-29 20:47:32 +00:00
72426b6194
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
am 6974f6a9: Merge "Block address families with routes, not NetworkAgent side channel" into lmp-dev
* commit '6974f6a97028a42ce79b8e9e1869af0ebf5624f4':
  Block address families with routes, not NetworkAgent side channel

Lorenzo Colitti   authored and   Android Git Automerger   commited 2014-09-24 01:29:36 +00:00
6240ff578c
am bb17a717: Merge changes I3ebf0cec,I8635472c into lmp-dev
* commit 'bb17a717750c558ece69344ecd93d96d4fbc4aca':
  Add a throw route to the VPN endpoint.
  Support non-unicast route types: unreachable and throw.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2014-09-23 03:21:21 +00:00
885024dd7d
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
Cleanup NetworkCapabilities.
Remove unused imports and variables.
Fix misspellings.
Added @Overrides.

Change-Id: I81f4adb0504e92d01c5465a0e14bc46d5ec3987e

Wink Saville   commited 2014-09-22 21:51:47 +00:00
b0f0792383
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