Commit Graph

1776 Commits

Author SHA1 Message Date
Lorenzo Colitti
9a0063cfca am 89f234c5: am 28ca40ff: am 425aacdc: Merge "Only use mDefaultDns if the network claims to offer Internet" into lmp-mr1-dev
* commit '89f234c56b44727434bf70594694f2daaa37dc3a':
  Only use mDefaultDns if the network claims to offer Internet
2014-12-02 07:07:41 +00:00
Lorenzo Colitti
89f234c56b am 28ca40ff: am 425aacdc: Merge "Only use mDefaultDns if the network claims to offer Internet" into lmp-mr1-dev
* commit '28ca40ff78dc5e62d0e26e7340b74ad6e5ba767e':
  Only use mDefaultDns if the network claims to offer Internet
2014-12-02 07:00:45 +00:00
Lorenzo Colitti
425aacdce0 Merge "Only use mDefaultDns if the network claims to offer Internet" into lmp-mr1-dev 2014-12-02 06:47:52 +00:00
Jeremy Joslin
2cb143348b am f8d0233b: am 33783a96: am 500f7811: Merge "Fix the ordering of extra values in the PI." into lmp-mr1-dev
* commit 'f8d0233b09c95860fa816c3b60372633a6a8b63e':
  Fix the ordering of extra values in the PI.
2014-12-01 20:07:32 +00:00
Jeremy Joslin
f8d0233b09 am 33783a96: am 500f7811: Merge "Fix the ordering of extra values in the PI." into lmp-mr1-dev
* commit '33783a962f3336400d12cd739ae33b9452ea14be':
  Fix the ordering of extra values in the PI.
2014-12-01 20:01:02 +00:00
Lorenzo Colitti
20068c2d12 Only use mDefaultDns if the network claims to offer Internet
Currently, if a network does not specify DNS servers, we default
it to using 8.8.8.8. This was done because the emulator did not
specify DNS servers. However, it causes queries to fail slowly,
instead of failing fast, on networks that do not have
connectivity to 8.8.8.8.

Bug: 18327075
Change-Id: I0df13ff4a17ee65e640be96695a3af31b020963a
2014-12-02 03:40:16 +09:00
Jeremy Joslin
de802a29a1 Fix the ordering of extra values in the PI.
Bug: 18539720
Change-Id: I6bb69394b05923ca25bc1b4902bc2540a13812bd
2014-11-26 14:24:15 -08:00
Paul Jensen
dbb383e443 am d1c7d285: am 58a493ac: am 1d27e7d6: Merge "Don\'t let NetworkMonitor state stop user-initiated transitions." into lmp-mr1-dev
* commit 'd1c7d28584cfb42abfd455ae478feb8b4426c746':
  Don't let NetworkMonitor state stop user-initiated transitions.
2014-11-26 19:42:10 +00:00
Paul Jensen
d1c7d28584 am 58a493ac: am 1d27e7d6: 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.
2014-11-26 18:43:29 +00:00
Paul Jensen
1d27e7d678 Merge "Don't let NetworkMonitor state stop user-initiated transitions." into lmp-mr1-dev 2014-11-26 12:05:01 +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
Jeff Davidson
c08f4ac258 am 6fdf2a17: am 30ddc724: 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.
2014-11-25 17:49:39 +00:00
Paul Jensen
f5ca486ba0 am 080b02fc: am b5f79d66: 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.
2014-11-25 17:37:54 +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
Jeff Davidson
30ddc724a0 Merge "Don't enforce control permission when preparing consented VPN." into lmp-mr1-dev 2014-11-24 21:19:56 +00:00
Paul Jensen
b5f79d66f0 Merge "Don't bother validating networks that don't satisfy the default request." into lmp-mr1-dev 2014-11-24 18:30:36 +00: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
Paul Jensen
f8b75aa88a 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
2014-11-24 11:11:32 -05: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 Davidson
ca3d8edfba 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
2014-11-21 12:56:29 -08: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
Paul Jensen
94ca422e71 am 63876284: 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.
2014-11-21 12:50:35 +00:00
Paul Jensen
638762845d Merge "Don't allow an uncreated Network to satsify requests." into lmp-mr1-dev 2014-11-21 12:42:34 +00:00
Geoffrey Borggaard
c991d99726 am 8a2ac41d: am cc9b1195: am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev automerge: e34455e
* commit '8a2ac41dcfa0ec10c09a7599d9345798c21cd47d':
  Fix null handling in proxies.
2014-11-21 10:31:03 +00:00
Geoffrey Borggaard
cc9b119566 am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev
automerge: e34455e

* commit 'e34455e4b44a125147d025f3310630600dbdab6d':
  Fix null handling in proxies.
2014-11-21 10:17:39 +00: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
Paul Jensen
ce90ecbaf7 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
2014-11-20 21:00:35 -05:00
Geoffrey Borggaard
e34455e4b4 am c3f5d718: Merge "Fix null handling in proxies." into lmp-dev
* commit 'c3f5d7183a21cb081bab1a6bca3fc115523e4e78':
  Fix null handling in proxies.
2014-11-20 20:59:00 +00:00
Geoffrey Borggaard
6ff743e424 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
2014-11-20 19:48:20 +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
Paul Jensen
262b462786 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
2014-11-19 13:11:30 -05: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
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
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
Robert Greenwalt
08881e11cf Merge "Fix Legacy typing of net-specific requests." into lmp-mr1-dev 2014-11-05 23:36:01 +00:00