Commit graph

1,664 commits

Message SHA1
am 58a493ac: am d59fd959: Merge "Don\'t let NetworkMonitor state stop user-initiated transitions." into lmp-mr1-dev
* commit '58a493accfeafa13fd77a16e832c5ad72a4c9006':
  Don't let NetworkMonitor state stop user-initiated transitions.

Paul Jensen   authored and   Android Git Automerger   commited 2014-11-26 18:43:29 +00:00
6877505cf1
Merge "Don't let NetworkMonitor state stop user-initiated transitions." into lmp-mr1-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-11-26 12:05:01 +00:00
d59fd959b4
am 6fdf2a17: am 65f31d8d: Merge "Don\'t enforce control permission when preparing consented VPN." into lmp-mr1-dev
* commit '6fdf2a1709c2006275d148e3156d249dcc27a99c':
  Don't enforce control permission when preparing consented VPN.

Jeff Davidson   authored and   Android Git Automerger   commited 2014-11-25 17:49:39 +00:00
ae48252896
am 080b02fc: am d8b132b7: Merge "Don\'t bother validating networks that don\'t satisfy the default request." into lmp-mr1-dev
* commit '080b02fc6c4531646d29ff4039080f2ac6d5f31a':
  Don't bother validating networks that don't satisfy the default request.

Paul Jensen   authored and   Android Git Automerger   commited 2014-11-25 17:37:54 +00:00
e85f9aaa83
am 608ea322: am eac470a9: Merge "Delete unused/non-working code." into lmp-mr1-dev
* commit '608ea322868385aaa46c20887795e72bf7068479':
  Delete unused/non-working code.

Sreeram Ramachandran   authored and   Android Git Automerger   commited 2014-11-25 15:10:20 +00:00
8ee414c445
am 4096a310: am 83f7111b: Merge "Allow VPNs to specify their underlying networks." into lmp-mr1-dev
* commit '4096a3107b070339ba06102a32a368f28a31f9a4':
  Allow VPNs to specify their underlying networks.

Sreeram Ramachandran   authored and   Android Git Automerger   commited 2014-11-25 15:10:14 +00:00
dedb930376
am 1d16570b: am 9a4a64cb: Merge "Eliminate race conditions in UID-based network filtering." into lmp-mr1-dev
* commit '1d16570b374ffaea89a3e3d403146008d12e60b9':
  Eliminate race conditions in UID-based network filtering.

Sreeram Ramachandran   authored and   Android Git Automerger   commited 2014-11-25 15:10:08 +00:00
8c06e6939a
Merge "Don't enforce control permission when preparing consented VPN." into lmp-mr1-dev
Jeff Davidson   authored and   Android (Google) Code Review   commited 2014-11-24 21:19:56 +00:00
65f31d8ddc
Merge "Don't bother validating networks that don't satisfy the default request." into lmp-mr1-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-11-24 18:30:36 +00:00
d8b132b7b2
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
eac470a946
Merge "Allow VPNs to specify their underlying networks." into lmp-mr1-dev
Sreeram Ramachandran   authored and   Android (Google) Code Review   commited 2014-11-24 17:24:04 +00:00
83f7111bdd
Merge "Eliminate race conditions in UID-based network filtering." into lmp-mr1-dev
Sreeram Ramachandran   authored and   Android (Google) Code Review   commited 2014-11-24 17:21:18 +00:00
9a4a64cb80
Don't let NetworkMonitor state stop user-initiated transitions.
GCM can call reportInetCondition() at any time which can cause
the NetworkMonitor to transition states to reevaluate at any time.
Previously we were only listening for users clicking the sign-in
notificaiton or completing sign-in when in the appropriate state.
With this change NetworkMonitor's state does not stop us from
listening for the user's actions.

bug:17917929
Change-Id: Ic1da31d90f7090e5fc111874cb7c37d505aaf590

Paul Jensen   commited 2014-11-24 11:11:32 -05:00
073b8ab2da
am 54c11274: am c0491a2e: Merge "Lightweight checkin output for network stats." into lmp-mr1-dev
* commit '54c11274b5e7ce9f774f7c846d7165563279b96a':
  Lightweight checkin output for network stats.

Jeff Sharkey   authored and   Android Git Automerger   commited 2014-11-21 22:09:28 +00:00
e6646ce80d
Don't enforce control permission when preparing consented VPN.
If a VPN app requests to be prepared and has already obtained user
consent, there is no need to additionally enforce the control
permission. We only need to enforce the control permission when a VPN
is first being prepared, where such a preparation would bypass user
consent.

Also ensure that in this case, the VPN being prepared matches the
calling app. Otherwise an app could prepare another pre-consented VPN,
which is not particularly dangerous but is likely unexpected.

Finally, remove misleading comment in ConnectivityService#prepareVpn.
This method IS called from VpnService.prepare(), not only from
system-privileged apps.

Bug: 18442887
Change-Id: Ic3227c6c1c74312697f0576d3811b06692a4edff

Jeff Davidson   commited 2014-11-21 12:56:29 -08:00
2b1cc9574c
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

Jeff Sharkey   commited 2014-11-21 10:11:10 -08:00
80330fb05d
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
af655d9e52
Delete unused/non-working code.
Change-Id: I2cba9ffdb4ed547cb922d0ac08abf81e49ffa66b

Sreeram Ramachandran   commited 2014-11-21 08:08:19 -08:00
5876d9ec20
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
44e21e44e3
am 9f8f78ca: Merge "Don\'t allow an uncreated Network to satsify requests." into lmp-mr1-dev
automerge: 934b73f

* commit '934b73fb50afd4280a1b6a509376ca86424fa7b2':
  Don't allow an uncreated Network to satsify requests.

Paul Jensen   authored and   android-build-merger   commited 2014-11-21 12:50:35 +00:00
f9576fc0eb
Merge "Don't allow an uncreated Network to satsify requests." into lmp-mr1-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2014-11-21 12:42:34 +00:00
9f8f78ca78
am 8a2ac41d: am 7057035c: am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev automerge: 0a1f0d7
* commit '8a2ac41dcfa0ec10c09a7599d9345798c21cd47d':
  Fix null handling in proxies.

Geoffrey Borggaard   authored and   Android Git Automerger   commited 2014-11-21 10:31:03 +00:00
a85c974f0c
am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev
automerge: 0a1f0d7

* commit '0a1f0d74f2':
  Fix null handling in proxies.

Geoffrey Borggaard   authored and   android-build-merger   commited 2014-11-21 10:17:39 +00:00
7057035ccc
am 4e9ea5e9: Merge "Rename EXTRA_NETWORK ConnectivityManager constants." into lmp-mr1-dev
automerge: dedd42a

* commit 'dedd42a2bdfafd6195d793949766d1c53f80ae51':
  Rename EXTRA_NETWORK ConnectivityManager constants.

Erik Kline   authored and   android-build-merger   commited 2014-11-21 02:57:09 +00:00
ad329e1659
Don't bother validating networks that don't satisfy the default request.
The only immediate change in behavior is not validating untrusted networks.

bug:18299572
bug:18394654

Change-Id: I8d626baf37db0bd0f55ddf3af8a0abf094a12369

Paul Jensen   commited 2014-11-20 21:00:35 -05:00
3f9386747b
am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev
* commit 'c3f5d7183a21cb081bab1a6bca3fc115523e4e78':
  Fix null handling in proxies.

Geoffrey Borggaard   authored and   Android Git Automerger   commited 2014-11-20 20:59:00 +00:00
0a1f0d74f2
Fix null handling in proxies.
ProxyInfo.getPacFileUrl() can not be null.  It will be equal to
Uri.EMPTY.  Checking for null was causing global proxies to never be
disabled.  Or more accurately, global proxies would be disabled, but
would reappear after a reboot.

ProxyInfo.getExclusionListByString() can be null.  If no
exclusion list was specified, the proxy settings would not be
successfully saved, they would disappear after reboot.

Bug: 18453223
Change-Id: I1c27e5dca5b9664bb7468ea909bff489fa110a07

Geoffrey Borggaard   commited 2014-11-20 19:48:20 +00:00
21523a4de1
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
fb087f1756
am c3507d10: Merge "Frameworks/base: Replace LOG_FATAL_IF in core/jni"
* commit 'c3507d1098a444176a7270cba7e5299af7f77350':
  Frameworks/base: Replace LOG_FATAL_IF in core/jni

Andreas Gampe   authored and   Android Git Automerger   commited 2014-11-19 18:26:51 +00:00
cda40e5fa6
Don't allow an uncreated Network to satsify requests.
This could happen when another Network changes its capabilities and
updateCapabilities() calls rematchAllNetworksAndRequests() which
calls rematchNetworkAndRequests() on all Networks, even those that
are uncreated.
Allowing uncreated Networks to satisfy requests can lead to bugs
where ConnectivityService instructs netd to perform actions
(e.g. set default Network) on uncreated Networks which netd doesn't
know about yet.

bug:18446301
Change-Id: I857262ac66d1d3af4c264ce128f0a4bee95655de

Paul Jensen   commited 2014-11-19 13:11:30 -05:00
adfd0a8857
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

Andreas Gampe   commited 2014-11-19 09:21:12 -08:00
ef378558c4
Merge "Populate 464xlat LinkProperties only when the interface comes up." into lmp-mr1-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-11-18 00:25:53 +00:00
3b5b0a22ea
Merge "air plane mode only send to the owner through the quick setting" into lmp-mr1-dev
xinhe   authored and   Android (Google) Code Review   commited 2014-11-17 22:18:11 +00:00
a5fd99e176
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

Jeff Davidson   commited 2014-11-17 21:03:10 +00:00
59b395fd7e
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

xinhe   commited 2014-11-17 11:35:01 -08:00
51e7703ca8
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

Lorenzo Colitti   commited 2014-11-10 19:33:13 -08:00
6fef3fd724
Merge "Send broadcasts when VPNs come and go." into lmp-mr1-dev
Sreeram Ramachandran   authored and   Android (Google) Code Review   commited 2014-11-06 21:57:21 +00:00
b063786c78
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
94c3099119
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
f70dd385e7
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
bb12fdf118
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
f59ed33835
Merge "Update network selections on capability change." into lmp-mr1-dev
Jeff Davidson   authored and   Android (Google) Code Review   commited 2014-11-05 17:41:36 +00:00
6633afee4b
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
f084aea4d7
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

Jeff Davidson   commited 2014-11-04 16:48:27 -08:00
ee17a4ec14
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

Sreeram Ramachandran   commited 2014-11-04 10:15:03 -08:00
d84f7f863c
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

Sreeram Ramachandran   commited 2014-11-03 11:39:53 -08:00
1d4504357c
Merge "Enable 464xlat on wifi." into lmp-mr1-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-10-30 13:28:03 +00:00
1f4c3496f3
Merge "Add support for running 464xlat on wifi as well." into lmp-mr1-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2014-10-30 13:27:54 +00:00
878bafa7fb
Enable 464xlat on wifi.
Bug: 12111730
Change-Id: If6d118a3c6e163262b09cc2fb3e3d3f9a81986ec

Lorenzo Colitti   commited 2014-10-30 20:31:27 +09:00
4061f43322
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

Lorenzo Colitti   commited 2014-10-30 20:31:26 +09:00
475674dc24