Commit Graph

2137 Commits

Author SHA1 Message Date
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
The Android Automerger
359ca19aaf merge in master-release history after reset to 97166e07905b55ab293606cb471dde48a3c89fa0 2014-11-19 05:54:59 -08:00
Lorenzo Colitti
c52ae42e2f Merge "Populate 464xlat LinkProperties only when the interface comes up." into lmp-mr1-dev 2014-11-18 00:25:53 +00:00
xinhe
b8ede29bec Merge "air plane mode only send to the owner through the quick setting" into lmp-mr1-dev 2014-11-17 22:18:11 +00:00
Jeff Davidson
a21f7a1ac6 Expose a SystemApi method to prepare a VPN without consent.
This is NOT designed to be called normally. Most apps (even
system-privileged ones) should request user consent before launching a
VPN. However, it is needed to support flows where consent can be
obtained through other means external to the VPN flow itself.

The API requires a system-privileged permission, CONTROL_VPN.

Bug: 18327583
Change-Id: I1bcdcf0fb5707faeb861ec4535e7ccffea369ae7
2014-11-17 21:03:10 +00:00
xinhe
5598f9c908 air plane mode only send to the owner through the quick setting
It should send to all the uesers as it behaves in setting

Bug:18353278
Change-Id: Ib46a97e30bfba73dd78fab0c8139d6ccb7ad210f
2014-11-17 11:35:01 -08:00
Lorenzo Colitti
38804ae6a4 Populate 464xlat LinkProperties only when the interface comes up.
Currently Nat464Xlat reads the clat IPv4 address and updates the
clat LinkProperties when the interface is created. This causes a
race condition: because clatd only sets the IPv4 address after
creating the interface, it's possible that Nat464Xlat will read
the address before clatd has set it, causing the framework to
think that the clat IPv4 address is 0.0.0.0/32.

This seems to be happening more frequently now, perhaps because
clatd takes a bit longer to configure the IPv4 address now that
it needs to check that the address is free before using it.

Fix this by making Nat464Xlat listen for the interface coming up
instead of listening for the interface being added.

Bug: 12111730
Change-Id: Ic1c59b5b6dbb851b7431d1b06885f67803373bb9
2014-11-10 19:33:13 -08:00
The Android Automerger
6f74bfdc80 merge in master-release history after reset to a4d5542ae40ec0827d49cdb088858e2663f7e8cf 2014-11-08 05:54:11 -08:00
Sreeram Ramachandran
2207207a7f Merge "Send broadcasts when VPNs come and go." into lmp-mr1-dev 2014-11-06 21:57:21 +00: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
The Android Automerger
c5906f1d09 merge in master-release history after reset to 55c3de783b0bacd4f8dd1302f7532c14d484986b 2014-11-06 05:54:43 -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
Jeff Davidson
157cb03474 Merge "Update network selections on capability change." into lmp-mr1-dev 2014-11-05 17:41:36 +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
The Android Automerger
9c6d5e3c2b merge in master-release history after reset to 4acb768ce8dfc65e3f6e067055c03c7bea4e37f8 2014-11-05 05:54:16 -08:00
Jeff Davidson
d36242ae5d Update network selections on capability change.
Among other reasons, this is needed when a Wi-Fi connection is
upgraded from untrusted to trusted, so that the default route can be
updated to point to the Wi-Fi network instead.

Bug: 18206275
Change-Id: I53f7a6f00f66a23ae4873fa2334cd8a621f39d4f
2014-11-04 16:48:27 -08:00
Sreeram Ramachandran
d9bf64ba1d Don't use framework permission strings for netd permissions.
These framework permission strings were being used as arbitrary labels
that mapped to netd permissions that have completely different meaning.
This leads to confusion, so use different strings.

Bug: 18194858
Change-Id: Ib3ec377ab26ce904d3d4678f04edec6cb1260517
2014-11-04 10:15:03 -08:00
Sreeram Ramachandran
e8cb66edba Send broadcasts when VPNs come and go.
This is achieved by adding TYPE_VPN as a supported legacy type.
Note that this is added in code, and not in a config.xml file,
so there's no way to remove TYPE_VPN (i.e., make it unsupported).

Bug: 17426546
Change-Id: I02eb5f22737720095f646f8db5c87fd66da129d6
2014-11-03 11:39:53 -08:00
The Android Automerger
f1fc0dee6f merge in master-release history after reset to 021e5db2b626626566fec7921ec9cbeae865106c 2014-11-03 05:54:30 -08:00
The Android Automerger
fab3efd8c4 merge in master-release history after reset to f0742ae95da5729ef5172ba3b850007341f45c27 2014-11-02 05:52:20 -08:00
The Android Automerger
b0edcb5522 merge in master-release history after reset to f0742ae95da5729ef5172ba3b850007341f45c27 2014-11-01 05:52:28 -07: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
Lorenzo Colitti
1b11eb6480 Merge "Enable 464xlat on wifi." into lmp-mr1-dev 2014-10-30 13:28:03 +00:00
Lorenzo Colitti
35bffcdd58 Merge "Add support for running 464xlat on wifi as well." into lmp-mr1-dev 2014-10-30 13:27:54 +00:00
The Android Automerger
81daeec9ac merge in master-release history after reset to f0742ae95da5729ef5172ba3b850007341f45c27 2014-10-30 05:52:37 -07:00
Lorenzo Colitti
9a66159292 Enable 464xlat on wifi.
Bug: 12111730
Change-Id: If6d118a3c6e163262b09cc2fb3e3d3f9a81986ec
2014-10-30 20:31:27 +09:00
Lorenzo Colitti
8e8662929b Add support for running 464xlat on wifi as well.
1. Add a command to NetworkManagementService to enable/disable
   IPv6 ND offload via netd.
2. Make Nat464Xlat enable offload if clatd successfully comes up
   on a wifi network (which means it detected a NAT64), and
   correspondingly re-enable offload when the clatd interface
   goes down.

This change does not enable clatd on wifi yet, that requires an
extra 2 lines to enable it.

Bug: 12111730
Change-Id: I4318611762a37487c9a84f8c4867ec5aece98be8
2014-10-30 20:31:26 +09:00
The Android Automerger
e6b29e7054 merge in master-release history after reset to f0742ae95da5729ef5172ba3b850007341f45c27 2014-10-29 05:53:01 -07: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
Lorenzo Colitti
67118eb4df Support more than one clatd at a time.
1. Make Nat464Xlat a per-network object, one for every network
   requiring clat, instead of a ConnectivityService singleton.
2. Make the NetworkManagementService clatd commands take an
   interface.
3. When we attempt to start clatd on a network, store its
   Nat464Xlat object in the NetworkAgentInfo, so we have an
   authoritative way of knowing whether clat is running on a
   given network.
4. Rework Nat464Xlat, hopefully simplifying it.

Bug: 12111730
Change-Id: I1fa5508ef020cd1c3d1c7a1f7b06370ac5fc2ae2
2014-10-29 01:23:26 +09:00
The Android Automerger
369449e226 merge in master-release history after reset to f0742ae95da5729ef5172ba3b850007341f45c27 2014-10-28 05:54:55 -07: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
Jeff Sharkey
c0e5d839a9 Follow API removal.
Bug: 18118003
Change-Id: Iad73ce748e05ba0660246e8dbb041415c187f792
2014-10-27 14:53:40 -07:00
The Android Automerger
36d15d4cc2 merge in master-release history after reset to fb9ac4c2d358278f9387b9518d5d1321f20c0e8c 2014-10-27 05:52:16 -07:00
The Android Automerger
79b56aee74 merge in master-release history after reset to fb9ac4c2d358278f9387b9518d5d1321f20c0e8c 2014-10-26 05:51:51 -07:00
The Android Automerger
a6cb6bd79c merge in master-release history after reset to fb9ac4c2d358278f9387b9518d5d1321f20c0e8c 2014-10-25 05:52:29 -07: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
The Android Automerger
2596bc8358 merge in master-release history after reset to 7adffa1cbc073507de25b65f0aa2501ea05c5a58 2014-10-18 05:53:25 -07:00
Lorenzo Colitti
31558633b3 am 28dcf034: Merge "Propagate network state changes to the LockdownVpnTracker." into lmp-dev
* commit '28dcf0345b2857884c1f1639fadb720318445187':
  Propagate network state changes to the LockdownVpnTracker.
2014-10-16 09:23:17 +00:00
Lorenzo Colitti
35495fadb1 Propagate network state changes to the LockdownVpnTracker.
Bug: 17695048
Change-Id: I10378df0ab545729a6a315fd1bc8870cd98f47b3
2014-10-16 01:16:50 +09:00
The Android Automerger
f0b056e339 merge in master-release history after reset to 06ef189fb664160d2545fa9a76910df0961924c6 2014-10-14 05:52:22 -07:00
The Android Automerger
47fdc0dd7c merge in master-release history after reset to 06ef189fb664160d2545fa9a76910df0961924c6 2014-10-13 05:51:53 -07:00
The Android Automerger
ea84565278 merge in master-release history after reset to 06ef189fb664160d2545fa9a76910df0961924c6 2014-10-12 05:51:34 -07:00