Commit Graph

811 Commits

Author SHA1 Message Date
Erik Kline
b5ae87a8d0 Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev 2014-12-04 03:14:02 +00:00
Lorenzo Colitti
8aae8b885a am 307422bd: am d99cd44f: am dc99c504: Merge "Make StatusBar display all default networks." into lmp-mr1-dev
* commit '307422bdefda3281eb211217d767027278d4f64b':
  Make StatusBar display all default networks.
2014-12-03 21:49:38 +00:00
Lorenzo Colitti
307422bdef am d99cd44f: am dc99c504: Merge "Make StatusBar display all default networks." into lmp-mr1-dev
* commit 'd99cd44f317a0e1b188a0033ebe4948f13c32491':
  Make StatusBar display all default networks.
2014-12-03 20:41:10 +00:00
Lorenzo Colitti
79bd2e2841 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
2014-12-02 10:27:05 -08:00
Erik Kline
2ca89c1005 am ee1d722e: am d125266b: am 4bcd4a79: Merge "Revert some verbose logging from ag/489226" into lmp-mr1-dev
* commit 'ee1d722e1c8e9af9eca005b4a6390f0295726f18':
  Revert some verbose logging from ag/489226
2014-12-02 07:42:45 +00:00
Erik Kline
ee1d722e1c am d125266b: am 4bcd4a79: Merge "Revert some verbose logging from ag/489226" into lmp-mr1-dev
* commit 'd125266b3c0cabcb42e6331a312c66071fedd752':
  Revert some verbose logging from ag/489226
2014-12-02 07:35:59 +00:00
Erik Kline
bd49990557 Revert some verbose logging from ag/489226
Bug: 18171889
Change-Id: I582a17b2272746e04717ac8da1d6984ff187ddf6
2014-11-26 09:01:16 +09:00
Erik Kline
ec6a80208e Merge "Map TYPE_VPN integer to "VPN" string." 2014-11-25 18:46:37 +00:00
Sreeram Ramachandran
f7bc40c6b5 am 608ea322: am 04f46a02: Merge "Delete unused/non-working code." into lmp-mr1-dev
* commit '608ea322868385aaa46c20887795e72bf7068479':
  Delete unused/non-working code.
2014-11-25 15:10:20 +00:00
Sreeram Ramachandran
7faa2a28d9 am 4096a310: am dadd493c: Merge "Allow VPNs to specify their underlying networks." into lmp-mr1-dev
* commit '4096a3107b070339ba06102a32a368f28a31f9a4':
  Allow VPNs to specify their underlying networks.
2014-11-25 15:10:14 +00:00
Sreeram Ramachandran
2e5f2d5fc6 am 1d16570b: am e4e7baac: Merge "Eliminate race conditions in UID-based network filtering." into lmp-mr1-dev
* commit '1d16570b374ffaea89a3e3d403146008d12e60b9':
  Eliminate race conditions in UID-based network filtering.
2014-11-25 15:10:08 +00:00
Erik Kline
137fadcd4c Map TYPE_VPN integer to "VPN" string.
Bug: 18439110
Change-Id: I0fa0c9e6a9293ab724e2b5e7d0f586f05cd100c7
2014-11-25 13:16:58 +09:00
Sreeram Ramachandran
04f46a029e Merge "Delete unused/non-working code." into lmp-mr1-dev 2014-11-24 17:24:26 +00:00
Sreeram Ramachandran
dadd493cee Merge "Allow VPNs to specify their underlying networks." into lmp-mr1-dev 2014-11-24 17:24:04 +00:00
Sreeram Ramachandran
e4e7baac57 Merge "Eliminate race conditions in UID-based network filtering." into lmp-mr1-dev 2014-11-24 17:21:18 +00:00
Jeff Sharkey
ada97e6c47 am 54c11274: am c0491a2e: Merge "Lightweight checkin output for network stats." into lmp-mr1-dev
* commit '54c11274b5e7ce9f774f7c846d7165563279b96a':
  Lightweight checkin output for network stats.
2014-11-21 22:09:28 +00:00
Jeff Sharkey
29c8eb028b Lightweight checkin output for network stats.
Define and print a compact version of network statistics when dump
is requested with the "--checkin" flag.  Defaults to last 24 hours,
but included data can be tweaked with various flags.

Groups together detailed network identities into larger umbrella
terms like "mobile" and "wifi."

Bug: 18415963
Change-Id: I70cf9c828ea5c6e5bb6884837d3608f66fbad2e6
2014-11-21 10:11:10 -08:00
Sreeram Ramachandran
d2b4fe2b2d 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
2014-11-21 09:26:18 -08:00
Sreeram Ramachandran
541254ae51 Delete unused/non-working code.
Change-Id: I2cba9ffdb4ed547cb922d0ac08abf81e49ffa66b
2014-11-21 08:08:19 -08:00
Sreeram Ramachandran
7c9871648e 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
2014-11-21 08:07:13 -08:00
Erik Kline
398bd1e774 am 4e9ea5e9: Merge "Rename EXTRA_NETWORK ConnectivityManager constants." into lmp-mr1-dev
automerge: dedd42a

* commit 'dedd42a2bdfafd6195d793949766d1c53f80ae51':
  Rename EXTRA_NETWORK ConnectivityManager constants.
2014-11-21 02:57:09 +00:00
Erik Kline
8a82621cdb 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
2014-11-20 13:16:31 +09:00
Andreas Gampe
13b551e033 am c3507d10: Merge "Frameworks/base: Replace LOG_FATAL_IF in core/jni"
* commit 'c3507d1098a444176a7270cba7e5299af7f77350':
  Frameworks/base: Replace LOG_FATAL_IF in core/jni
2014-11-19 18:26:51 +00:00
Andreas Gampe
bc7c99de7a Frameworks/base: Replace LOG_FATAL_IF in core/jni
Do not use LOG_FATAL_IF in JNI setup. This is one-time on startup
and important enough to always check.

Add a header with common helper definitions. Move to inlined functions
instead of macros to clean up the code.

Change-Id: Ib12d0eed61b110c45d748e80ec36c563e9dec7e5
2014-11-19 09:21:12 -08:00
Jeremy Joslin
60d379b618 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
2014-11-06 11:43:27 -08:00
Robert Greenwalt
08881e11cf Merge "Fix Legacy typing of net-specific requests." into lmp-mr1-dev 2014-11-05 23:36:01 +00:00
Robert Greenwalt
08c7c9803c 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
2014-11-05 15:06:20 -08:00
Paul Jensen
821255f29e Merge "Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()" into lmp-mr1-dev 2014-11-05 19:05:09 +00:00
Paul Jensen
aadf9b78b4 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
2014-11-05 09:35:26 -05:00
Erik Kline
8eb37760ae 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
2014-10-31 14:07:33 +09:00
Erik Kline
143e89c2f1 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
2014-10-29 19:11:58 +09:00
Erik Kline
a7691fcb44 Merge "(re)define the definition of "provisioned"" into lmp-mr1-dev 2014-10-28 07:53:37 +00:00
Lorenzo Colitti
846ae01231 Merge "Change removeStackedLink to take an interface name." into lmp-mr1-dev 2014-10-28 07:00:31 +00:00
Lorenzo Colitti
3825843c73 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
2014-10-28 15:13:57 +09:00
Erik Kline
8b02307fd5 (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
2014-10-28 14:47:42 +09:00
Narayan Kamath
923d9a405c Merge "Deprecate more apache-http." into lmp-mr1-dev 2014-10-24 08:58:45 +00:00
Narayan Kamath
38c2dc3b49 Deprecate more apache-http.
bug: 18067888

Change-Id: I50511d53dfc9ae236dfb1646c55a5dd7fa15d7b2
2014-10-23 17:43:05 +01:00
Sreeram Ramachandran
76a545ffc4 Add an API to select a network for a DatagramSocket.
Mirrors the API that does this for Sockets.

Bug: 18076907
Change-Id: Ifa27b39e23797558546aab751fbfb3aed3b7dbcb
2014-10-23 08:37:33 -07:00
Robert Greenwalt
db4908dc1c am 707d0288: Merge "Send callbacks for Net property changes" into lmp-dev
* commit '707d028804d968bec423f0b8b2c007c4a82ff222':
  Send callbacks for Net property changes
2014-10-03 15:41:04 +00:00
Robert Greenwalt
e525a0a7f7 Send callbacks for Net property changes
LinkProperties and NetworkCapabilities changes were not calling app callbacks.

bug:17681483
Change-Id: I67dac3c4dc1284f5c4bfb24de239da4ec776336f
2014-10-02 21:05:44 -07:00
Paul Jensen
72426b6194 am ebeaecde: Move mobile provisioning APN support into telephony.
* commit 'ebeaecde71b34ba32a2cc602c09e4822b8ecbf97':
  Move mobile provisioning APN support into telephony.
2014-09-29 20:47:32 +00:00
Paul Jensen
ebeaecde71 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
2014-09-29 11:37:43 +00:00
Lorenzo Colitti
6240ff578c 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
2014-09-24 01:29:36 +00:00
Lorenzo Colitti
885024dd7d 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.
2014-09-23 03:21:21 +00:00
Lorenzo Colitti
83d12dbbb7 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
2014-09-23 10:48:28 +09:00
Wink Saville
b0f0792383 Cleanup NetworkCapabilities.
Remove unused imports and variables.
Fix misspellings.
Added @Overrides.

Change-Id: I81f4adb0504e92d01c5465a0e14bc46d5ec3987e
2014-09-22 21:51:47 +00:00
Lorenzo Colitti
2129034e25 Support non-unicast route types: unreachable and throw.
Bug: 17462989
Change-Id: I8635472ca3e96ec2866af2de48e6260ab2da13fb
2014-09-22 13:10:15 +09:00
Robert Greenwalt
61b67c71c5 Merge "Use unified Tethering Permission Check" into lmp-dev 2014-09-18 00:02:16 +00:00
Robert Greenwalt
3c5dee0a26 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
2014-09-17 16:18:12 -07:00
Jeff Sharkey
d44d6c7e8c Merge "NetworkStats always needs arrays." into lmp-dev 2014-09-17 19:01:13 +00:00