Commit graph android_packages_modules_Co.../core/java
Message SHA1
Add captive portal API.
This API allows apps other than the system's CaptivePortalLogin
to handle signing in to captive portals.

bug:19416463
Change-Id: I27fce5856b635233e6ff66396d50ccabedd76cf5

Paul Jensen   commited 2015-04-16 16:53:10 +00:00
60df4aaea6
LCE service implementation - connectivity side
Change-Id: If11bd99c44c7dc8d2aa2bc05a10e04421739baa6

fenglu   commited 2015-04-15 23:13:52 -07:00
d39aecfa33
multinetwork API: native implementation
Bug: 19537384
Change-Id: I04f4a7de2b1e583989b67a853df6ab50289c2185

Erik Kline   commited 2015-04-15 15:52:31 +09:00
9157e0092b
Deprecate connectivity APIs relying on integer network types.
Recommend ConnectivityManager.getAllNetworks() and various state
inspection functions as a way forward.

Bug:19608294
Change-Id: Ibd53629995897047fc532ffa56f079dfba10a7c7

Paul Jensen   commited 2015-04-14 17:51:27 +00:00
dda8e59411
Add ConnectivityManager.reportNetworkConnectivity() API
This new API allows reporting networks that are perceived to provide Internet
connectivity and networks that are not.  This allows the framework to avoid
needlessly reevaluating networks where the apps perception matches the
framework's perception.  This was not possible with the prior API,
reportBadNetwork.

Bug: 16214361
Change-Id: Id4409bd7538854bd837231fb50e693c10a62b4f2

Paul Jensen   commited 2015-04-13 18:48:54 +00:00
b95d7950f5
Add ConnectivityManager.getActiveNetwork().
Rework NetID allocation in ConnectivityService so registerNetworkAgent() can
return the allocated NetID.

Bug: 19416463
Change-Id: I68e395552cf27422c80b4dfae5db5d56a0d68f5d

Paul Jensen   commited 2015-04-10 14:03:13 +00:00
1f567385ff
Non-functional code cleanup of ConnectivityService.
1. Remove ConnectivityService.findConnectionTypeForIface() as this can be done
   just as easily with supported APIs now.
2. Avoid making copies of Network objects as this precludes reuse of Network
   internals (e.g. socket factory, connection pool).

Change-Id: I52f92e35d769d8350471f485e408169608630082

Paul Jensen   commited 2015-04-08 07:46:49 -04:00
c7a1d23cdf
Unhide Network.openConnection(URL, Proxy).
Spun off from
https://partner-android-review.googlesource.com/#/c/205463/ for
ease of review.

Bug: 19416463
Change-Id: Ia37a53a350d55b5514b949242368dfe396f6b9a0

Lorenzo Colitti   commited 2015-04-07 13:13:20 +09:00
224ab3d3a3
Fix typos in ConnectivityManager documentation.
Spun off from
https://partner-android-review.googlesource.com/#/c/205463/ for
ease of review.

Bug: 19416463
Change-Id: I2f88ac415177ecd96c9191df5e390830869f52e1

Paul Jensen   authored and   Lorenzo Colitti   commited 2015-04-07 13:13:13 +09:00
bd2d378b7f
Deprecate EXTRA_PROXY_INFO and unhide ConnectivityManager.getDefaultProxy().
1. Unhide ConnectivityManager.getDefaultProxy() and update it to
   take into account process-bound-Networks.
2. Deprecate EXTRA_PROXY_INFO and instead encourage querying via
   getDefaultProxy().

Bug: 17905627
Bug: 17420465
Bug: 18144582

Change-Id: I45358ee82fe705d048022c8238b2452f52c37b88

Paul Jensen   commited 2015-04-03 07:25:55 -04:00
6fabfa0e32
Deprecate static ConnectivityManager.get/setProcessDefaultNetwork() functions.
These functions risk hitting an unchecked Exception due to ConnectivityManager
not being instantiated yet.  Also, change Network.openConnection() to throw a
checked Exception rather than an unchecked Exception when ConnectivityManager
is not yet instantiated.

bug:19416463
Change-Id: Ie1e2b3238aec0343d267c76b64927073f2f05f85

Paul Jensen   commited 2015-04-02 14:03:43 +00:00
ee2f45d85f
Merge "Make NetworkCapabilities.NOT_VPN javadoc visible." into m-wireless-dev
Paul Jensen   authored and   Android Partner Code Review   commited 2015-03-20 11:27:18 +00:00
703642c635
Remove dead code, mostly DataStateTracker.
(cherry picked from AOSP commit 9edb1fc511)

Change-Id: I18c44cd08dfb51e02a96d0b726e9af1db21e3058

Paul Jensen   commited 2015-03-18 12:29:13 -04:00
8357dfd520
Make NetworkCapabilities.NOT_VPN javadoc visible.
Also adjust wording to be more suitable for NetworkRequests and NetworkAgents.

Change-Id: I1cc93cb20779cf02d6ffa0fa11ad2916c199b365

Paul Jensen   commited 2015-03-18 09:33:07 -04:00
ba9c42f661
Add a protectFromVpn method that takes a FileDescriptor
Bug: 19704592
Change-Id: I9aeb29c2f6cf55fa010bc606c99b21a797ac5a19

Lorenzo Colitti   commited 2015-03-17 19:46:12 +09:00
b85f0b44a7
Merge changes from topic 'dhcpclient' into m-wireless-dev
* changes:
  DHCP: Minor cleanups to the packet code.
  DHCP: Move the packet code to frameworks/base/services.
  DHCP: Add a native method for making a DHCP socket.
  DHCP: Add a superclass for DhcpStateMachine.

Lorenzo Colitti   authored and   Android Partner Code Review   commited 2015-03-16 12:12:42 +00:00
1271037d00
Merge "Add two utility methods for IPv4 netmasks." into m-wireless-dev
Lorenzo Colitti   authored and   Android Partner Code Review   commited 2015-03-16 12:11:37 +00:00
0210a8c5d9
DHCP: Add a native method for making a DHCP socket.
Bug: 19704592
Change-Id: Iadd60d39c93aaabd2917e76791101a7d313b34be

Lorenzo Colitti   commited 2015-03-16 20:08:45 +09:00
c70fbac892
Add two utility methods for IPv4 netmasks.
1. Add a validating method to convert a netmask to a prefix length.
2. Add a function to get the implicit netmask of an IPv4 address.
3. Add a unit test.

Bug: 19704592
Change-Id: Icb9f58d3903ea01df9e3720383c9bd5db6dd8f26

Lorenzo Colitti   commited 2015-03-16 16:07:36 +09:00
e82e0f0a8c
Fix javadoc braces for ConnectivityManager.EXTRA_NETWORK.
Change-Id: I5ad30a34f96e9e99a557b5bae9a30bfc08c89620

Paul Jensen   commited 2015-03-13 14:06:12 -04:00
051135c956
Refactor NetworkUtils interaction with DHCP.
Separate out starting DHCP (DISCOVER) and RENEW operations from fetching
the results.  Add NetworkUtils.getDhcpResults(), to enable quick checks
of any available DhcpResults without extraneous interaction with the
DHCP daemon.

Bug: 19422416
Change-Id: I58808e529dda8429737e749f5caef56d923c0809

Erik Kline   commited 2015-03-02 12:35:35 +09:00
9def7be67d
Update Javadoc for EXTRA_NETWORK.
Bug: 19352840
Change-Id: Ib668bee0fb2c6f5bcd01a7908ebd20b9ec8a40ef

Jeremy Joslin   commited 2015-02-11 18:28:57 -08:00
c53026391a
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
Change-Id: I822e1d754b336691b675438eefa959a3d75fd07b

Lorenzo Colitti   commited 2015-01-23 21:10:34 +09:00
64f1689c81
Clear process DNS NetID binding when expiring or releaseing legacy requests.
When requests made by ConnectivityManager.startUsingNetworkFeature() are
expired or are canceled via ConnectivityManager.stopUsingNetworkFeature(),
we must remember to clear the binding of DNS requests from the calling
process to the Network satisfying the request.

bug:18778725
Change-Id: I800c808ac6486000241b5d263aa79a1192a9fe9e

Paul Jensen   commited 2015-01-06 09:43:04 -05:00
49f74a382b
Merge "Fix several HTTP proxy issues with multinetworking." into lmp-mr1-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-12-11 04:51:16 +00:00
7a0d9799c8
Fix several HTTP proxy issues with multinetworking.
1. Send PROXY_CHANGE_ACTION broadcast when any network's proxy changes,
   not just the default network.
2. When a process is bound to a particular Network, update the proxy
   system properties to those for the bound Network, and keep them
   updated when PROXY_CHANGE_ACTION broadcasts are received.
3. Make Network.openConnection() use the proxy for the Network.

bug:17905627
bug:17420465
bug:18144582

(cherry-pick of https://android-review.googlesource.com/#/c/115170)

Change-Id: Ia2819985e6108a8c121e74c683a5646becfd0a97

Paul Jensen   commited 2014-12-10 15:22:12 -05:00
c0618a69f1
Merge "Re-remove CONNECTIVITY_CHANGE_DELAY and supporting functions." into lmp-mr1-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2014-12-10 07:29:47 +00:00
63aba09c17
Merge "Add subId as parameter for get/setDataEnabled." into lmp-mr1-dev
Wink Saville   authored and   Android (Google) Code Review   commited 2014-12-09 17:52:27 +00:00
6490d8694a
Offer to "merge" subscribers for data usage.
There are some cases where multiple subscriber identities (IMSI)
should be treated as "merged together" from a data usage
perspective.  This is done by extending the template used for
matching purposes to support multiple subscribers.

Then, when we query historical usage or set network policies, we
normalize the matching template to merge to any other identities
that should be included.  When normalizing, the "lowest" identity
is always used for equality and storage purposes, which allows
identities to come and go over time.

This change also fixes data usage recording for multi-SIM devices
by passing along the concrete subscriber identity for each network
interface.  Also correctly create default policies for multi-SIM
devices.  This change also drops setPolicyDataEnable() until it can
be wired up to the right underlying NetworkAgent.  (This means we
still bring up the network, and then rely on iptables rules to block
traffic when over the limit, instead of proactively disabling the
connection.)

Bug: 18012787
Change-Id: If6acf32009fdfea2b836f5aff8e2f3e5e0248b4a

Jeff Sharkey   commited 2014-12-08 08:42:59 -08:00
fffa983fe4
Re-remove CONNECTIVITY_CHANGE_DELAY and supporting functions.
Since optimistic addresses are useable upon kernel notification
there is no need for this extra connectivity delay.

---

This functionality was originally submitted in ag/572619.  Owing
to issues with bind()ing to optimistic addresses (see b/18609055)
this was reverted in ag/598673.

This reverts the revert.  :-)

Bug: 17769720
Change-Id: Ibee490b2af72050693b6bd748193f51e312ca527

Erik Kline   commited 2014-12-08 16:25:20 +09:00
b883659514
Add subId as parameter for get/setDataEnabled.
Bug: 18279333
Change-Id: I2496a2fd92b154e5e6981cbf6b5b5939cda59122

Wink Saville   commited 2014-12-05 11:10:30 -08:00
689f70442c
Revert "Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev"
This is the revert of ag/572619.

This reverts commit b5ae87a8d0, reversing
changes made to 32b61ab28f54e5b00f472b2166f9b1100375e4ff.

Bug: 18609055
Bug: 17769720
Change-Id: I122eba200f2071d4e5777ec34c1d04fb567345a8

Erik Kline   authored and   Pavel Zhamaitsiak   commited 2014-12-05 18:02:56 +00:00
c1529548aa
Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2014-12-04 03:14:02 +00:00
b5ae87a8d0
Make StatusBar display all default networks.
The basic principle is: if an app's traffic could possibly go
over a network without the app using the multinetwork APIs (hence
"by default"), then the status bar should show that network's
connectivity.

In the normal case, app traffic only goes over the system's default
network connection, so that's the only network returned.

With a VPN in force, some app traffic may go into the VPN, and thus over
whatever underlying networks the VPN specifies, while other app traffic
may go over the system default network (e.g.: a split-tunnel VPN, or an
app disallowed by the VPN), so the set of networks returned includes the
VPN's underlying networks and the system default.

Specifically:

1. Add a NETWORK_CAPABILITY_VALIDATED bit to NetworkCapabilities.
2. Add a hidden API to retrieve the NetworkCapabilities of
   all default networks for a given macro-user.
3. Modify the status bar code that used getActiveNetworkInfo to
   determine which network was active, and make it consider all
   validated networks instead.
4. Because the set of active networks depends on which VPN app
   the user is running, make the status bar re-evaluate the
   networking situation when the active user changes.

Bug: 17460017
Change-Id: Ie4965f35fb5936b088e6060ee06e362c22297ab2

Lorenzo Colitti   authored and   Jeff Davidson   commited 2014-12-02 10:27:05 -08:00
79bd2e2841
Revert some verbose logging from ag/489226
Bug: 18171889
Change-Id: I582a17b2272746e04717ac8da1d6984ff187ddf6

Erik Kline   commited 2014-11-26 09:01:16 +09:00
bd49990557
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
Remove CONNECTIVITY_CHANGE_DELAY and friends.
Once optimistic addresses become useable upon kernel notification
there will be no need for a connectivity delay.

This change requires kernel changes like:
    https://android-review.googlesource.com/#/c/109934

Bug: 17769720
Change-Id: I8510c540aa655aad6a82ee322d591331357ee272

Erik Kline   commited 2014-10-31 14:07:33 +09:00
8eb37760ae
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