Commit Graph

1691 Commits

Author SHA1 Message Date
Jeremy Joslin
a0922b09ee am c4b2ec1a: am 6e39f696: Merge "Don\'t send the same PendingIntent more than once." into lmp-mr1-dev
* commit 'c4b2ec1a3a808c2dae0894e5f0cfd43d6ec1d5a2':
  Don't send the same PendingIntent more than once.
2014-12-08 19:36:27 +00:00
Paul Jensen
8ee62819bb am a4afe13a: am 26c6a232: Merge "Reap unvalidated networks that have no chance of becoming highest scoring." into lmp-mr1-dev
* commit 'a4afe13af38c03ae6abb76d2cf36ae0672328fd8':
  Reap unvalidated networks that have no chance of becoming highest scoring.
2014-12-08 19:36:08 +00:00
Dianne Hackborn
cfe01d2991 am e52a2ea0: am f91526ce: Merge "Fix issue #17323751: Additional items in aggregated battery stats" into lmp-mr1-dev
* commit 'e52a2ea03bd7b8ed2f3680c5198e00fb7ad5c34c':
  Fix issue #17323751: Additional items in aggregated battery stats
2014-12-08 19:33:49 +00:00
Pavel Zhamaitsiak
d7d4a9c811 am d89f0d3d: am b81ce34a: Merge "Revert "Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev"" into lmp-mr1-dev
* commit 'd89f0d3d54dec1662b1cfed6c8e574ffcc8032d9':
  Revert "Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev"
2014-12-08 19:16:43 +00:00
Jeremy Joslin
6e39f696b7 Merge "Don't send the same PendingIntent more than once." into lmp-mr1-dev 2014-12-06 02:05:22 +00:00
Paul Jensen
26c6a232bb Merge "Reap unvalidated networks that have no chance of becoming highest scoring." into lmp-mr1-dev 2014-12-06 01:23:56 +00:00
Jeremy Joslin
1d3acf930f Don't send the same PendingIntent more than once.
Fixing a bug where a NetworkRequest's PendingIntent can be sent more
than once when networks are rematched before the intent completes.

Added a small delay before removing the request to give the receiving
client an opportunity to put in its own request. The delay value is
configurable via Settings.Secure.

Bug: 18614074
Change-Id: Iac7c5e5a04f42f2b6794e9e22349cc631bebeab7
2014-12-05 14:58:04 -08:00
Dianne Hackborn
f91526cec0 Merge "Fix issue #17323751: Additional items in aggregated battery stats" into lmp-mr1-dev 2014-12-05 22:54:08 +00:00
Dianne Hackborn
37e2d0e068 Fix issue #17323751: Additional items in aggregated battery stats
- Now aggregate number of times each process has crashed and ANRed.
- Now aggregate total number of connectivity changes.
- Now record connectivity changes in the history.

Crash and ANR counts are new entries at the end of "pr" in checkin.

Connectivity change counts is a new entry at the end of "m" in checkin.

Connectivity changes in the history checkin are Ecn and include the
type of connection and its state.

Change-Id: I0c01186446034cf6c3fb97d45f5e3b5c69a0438a
2014-12-05 13:54:24 -08:00
Paul Jensen
f43033a63e am 461e7367: am 1f4d121b: Merge "Remember to cancel lingering when a network again satsifies a NetworkRequest." into lmp-mr1-dev
* commit '461e73677d208e4e97356cbc781ce490b90e2027':
  Remember to cancel lingering when a network again satsifies a NetworkRequest.
2014-12-05 20:18:45 +00:00
Erik Kline
c1529548aa 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
2014-12-05 18:02:56 +00:00
Erik Kline
e9d534d537 am 95b5ca90: am b5ae87a8: Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev
* commit '95b5ca9019720c4c012ca13791d32aa6d0bb5ba8':
  Remove CONNECTIVITY_CHANGE_DELAY and friends.
2014-12-04 21:45:33 +00:00
Paul Jensen
1f4d121b74 Merge "Remember to cancel lingering when a network again satsifies a NetworkRequest." into lmp-mr1-dev 2014-12-04 19:27:52 +00:00
Paul Jensen
5c4e5fc0b9 Reap unvalidated networks that have no chance of becoming highest scoring.
These networks are unneeded and waste battery.  We won't bring up these
networks in the first place if they have no chance of becoming highest scoring.
This change handles the case where these networks are already up and
transition to a state where they have no chance of becoming highest scoring.
This happens when another network validates with a score higher than this
network can ever hope to attain.

bug:18489123
Change-Id: I77a96a72e250e25e44e0c50e7a928af8b35bb6ab
2014-12-04 11:22:39 -05:00
Erik Kline
b5ae87a8d0 Merge "Remove CONNECTIVITY_CHANGE_DELAY and friends." into lmp-mr1-dev 2014-12-04 03:14:02 +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
Paul Jensen
d5f533917d Remember to cancel lingering when a network again satsifies a NetworkRequest.
When WiFi's score drops and then comes back up we would previously linger
WiFi but forget to cancel the linger timeout, so 30s later WiFi would
unexpectedly tear down.  Also, make sure this is only done for created
Networks as "created" is the signal to initialy match Networks and requests.

bug:18169560
Change-Id: Ia69b110f6473371e556c60b950253758e023b7aa
2014-12-02 09:26:17 -05: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
4bcd4a7950 Merge "Revert some verbose logging from ag/489226" into lmp-mr1-dev 2014-12-02 07:22:33 +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
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
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
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
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