Commit Graph

1723 Commits

Author SHA1 Message Date
Neil Fuller
1c60d1208f resolved conflicts for merge of 7382c02d to lmp-mr1-dev-plus-aosp
Change-Id: Idfa2750230aa56e7ae34fcc33d62558df942abd0
2015-01-20 13:21:58 +00:00
Neil Fuller
c30362d9cf Changes associated with an OkHttp upgrade
Change-Id: I2a4db602aa7ffdef886e0f1a955715a2551a87a5
2015-01-20 11:59:24 +00:00
Paul Jensen
706f977c29 am be61ffa4: am 831fb40a: Merge "Don\'t blindly teardown unvalidated networks when releasing NetworkRequests." into lmp-mr1-dev
* commit 'be61ffa4fe42b4e6fdb677c7b1aeefb43ad3ef9f':
  Don't blindly teardown unvalidated networks when releasing NetworkRequests.
2015-01-14 19:24:09 +00:00
Paul Jensen
831fb40ae5 Merge "Don't blindly teardown unvalidated networks when releasing NetworkRequests." into lmp-mr1-dev 2015-01-14 12:39:01 +00:00
Paul Jensen
9e078d2f14 Don't blindly teardown unvalidated networks when releasing NetworkRequests.
These networks may be on their way to becoming validated at which point
they could satisfy the default NetworkRequest.  This change unifies the
is-this-network-needed code into a single function.

bug:18652378
Change-Id: Ia511d5c66be79b47dd7c9348ec02784ab30b960c
2015-01-13 09:05:38 -05:00
Paul Jensen
d2a3c85f1d am 60944390: Merge "Remember to cancel lingering when a network again satsifies a NetworkRequest." into lmp-mr1-dev
automerge: 63e2b8e

* commit '63e2b8e058f379582d0325aa84b5de6bfa73e15b':
  Remember to cancel lingering when a network again satsifies a NetworkRequest.
2015-01-10 02:08:59 +00:00
Paul Jensen
40e43de8d0 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.  This was not completely fixed in d5f5339.

bug:18826162
Change-Id: I7bb4b99ec969099e9815f46d4c09253be71a29be
2015-01-08 10:49:34 -05:00
Paul Jensen
81af1e4f39 am 6c93739f: am 49f74a38: Clear process DNS NetID binding when expiring or releaseing legacy requests.
* commit '6c93739f2f25c8afb77997165fa86be537df67a9':
  Clear process DNS NetID binding when expiring or releaseing legacy requests.
2015-01-06 14:57:44 +00:00
Paul Jensen
49f74a382b Clear process DNS NetID binding when expiring or releaseing legacy requests.
When requests made by ConnectivityManager.startUsingNetworkFeature() are
expired or are canceled via ConnectivityManager.stopUsingNetworkFeature(),
we must remember to clear the binding of DNS requests from the calling
process to the Network satisfying the request.

bug:18778725
Change-Id: I800c808ac6486000241b5d263aa79a1192a9fe9e
2015-01-06 09:43:04 -05:00
Narayan Kamath
5e73d1799f am d3d95172: am 38c2dae5: Merge "Remove hardcoded include paths."
* commit 'd3d95172c3645a1d7a12e540638207ae4fb69cae':
  Remove hardcoded include paths.
2014-12-31 10:19:00 +00:00
Narayan Kamath
0620227e62 Remove hardcoded include paths.
ICU, zlib & openssl export them using LOCAL_EXPORT_C_INCLUDE_DIRS.
The dependency on libc/dns/include was bogus and can be removed
trivially.

bug: 18581021
Change-Id: I4b8047ff0df1050ab48b61c0c886888b3f2f0c18
2014-12-31 10:06:51 +00:00
Robert Greenwalt
8ed2ad1c50 am 33868dab: am 4dcacef5: Merge "Fix timing between bcast and net setup." into lmp-mr1-dev
* commit '33868dab9af09d61634f1f7ab3a8c704aacd0de0':
  Fix timing between bcast and net setup.
2014-12-26 20:30:32 +00:00
Robert Greenwalt
70116ce13c Fix timing between bcast and net setup.
A legacy network type request would generate a bcast before the network
notification was sent - the legacy startUsingNetworkFeature API requires
the notification so it can bind your dns queries to the new network.
Fast-moving clients could try to use the network before it was ready.

bug:18792871
Change-Id: I24c46ef15c249c50bfc321f62756d1f66dc3a6a9
2014-12-19 11:54:27 -08:00
Lorenzo Colitti
71860bbba7 am 7e81cdef: am 5f82daec: Add a lastValidated bit and use it when reporting capabilities.
* commit '7e81cdef3625b52642969dd226a1446745e633e8':
  Add a lastValidated bit and use it when reporting capabilities.
2014-12-19 10:47:26 +00:00
Lorenzo Colitti
aa48e8f77e am b069e434: am a8de5ca5: Rename validated to everValidated.
* commit 'b069e434cba6dd8f949c3ebe44507da32aef3496':
  Rename validated to everValidated.
2014-12-19 10:47:20 +00:00
Lorenzo Colitti
5f82daecad Add a lastValidated bit and use it when reporting capabilities.
When we switched the way the status bar determines if a
connection is validated from using INET_CONDITION_ACTION
broadcasts to calling getDefaultNetworkCapabilitiesForUser(),
the statusbar stopped displaying ! when a network stopped having
working Internet connectivity. This is because the validated bit
is never set to false once a network is validated.

Fix this, hopefully temporarily, by introducing a new validated
bit that does go back to being false when a network no longer
has working connectivity, and use that bit in
getDefaultNetworkCapabilitiesForUser().

Bug: 18777225
Change-Id: I991c068be50252391d0e64c647fcf2e053dc82f9
2014-12-19 19:10:42 +09:00
Lorenzo Colitti
a8de5ca5cc Rename validated to everValidated.
This is a straight rename and thus a complete no-op from a
functionality perspective.

Bug: 18777225
Change-Id: I140d7640f1460c869a311294873772819a7a7059
2014-12-19 19:10:42 +09:00
Paul Jensen
32b6f2aa5f am 24594794: am b0575a24: Merge "Fix race between CONNECTIVITY_ACTION and setting default network." into lmp-mr1-dev
* commit '24594794cbb9bf6bb9c8b57e4427c88efee82304':
  Fix race between CONNECTIVITY_ACTION and setting default network.
2014-12-17 13:05:39 +00:00
Paul Jensen
0353fe5d99 Fix race between CONNECTIVITY_ACTION and setting default network.
Now that the delay between connectivity changes and CONNECTIVITY_ACTION
has been removed (ag/599650) races between CONNECTIVITY_ACTION and
the setting of the default network become more evident.
In http://crbug.com/441818 Chrome is calling getaddrinfo()
immediately after a device goes from no connectivity to cellular
connectivity, and Chrome is erroneously getting back EAI_NODATA
because netd hasn't yet set the default network for DNS resolutions.

bug:18757162
Change-Id: Ib607dcb3697403272a8c838713a9cb602e9c6820
2014-12-15 15:20:30 -05:00
Paul Jensen
d6524c4eb5 am 7a0d9799: Merge "Fix several HTTP proxy issues with multinetworking." into lmp-mr1-dev
automerge: d9d48cc

* commit 'd9d48cc9c7ab0d1590918e199917968eafc48288':
  Fix several HTTP proxy issues with multinetworking.
2014-12-11 05:49:18 +00:00
Paul Jensen
7a0d9799c8 Merge "Fix several HTTP proxy issues with multinetworking." into lmp-mr1-dev 2014-12-11 04:51:16 +00:00
Paul Jensen
c0618a69f1 Fix several HTTP proxy issues with multinetworking.
1. Send PROXY_CHANGE_ACTION broadcast when any network's proxy changes,
   not just the default network.
2. When a process is bound to a particular Network, update the proxy
   system properties to those for the bound Network, and keep them
   updated when PROXY_CHANGE_ACTION broadcasts are received.
3. Make Network.openConnection() use the proxy for the Network.

bug:17905627
bug:17420465
bug:18144582

(cherry-pick of https://android-review.googlesource.com/#/c/115170)

Change-Id: Ia2819985e6108a8c121e74c683a5646becfd0a97
2014-12-10 15:22:12 -05:00
Erik Kline
e1bf37a85e am 63aba09c: Merge "Re-remove CONNECTIVITY_CHANGE_DELAY and supporting functions." into lmp-mr1-dev
automerge: 56d2e8f

* commit '56d2e8fb7b2ab6e32efea59604eb0cd72745df1b':
  Re-remove CONNECTIVITY_CHANGE_DELAY and supporting functions.
2014-12-10 19:06:50 +00:00
Erik Kline
63aba09c17 Merge "Re-remove CONNECTIVITY_CHANGE_DELAY and supporting functions." into lmp-mr1-dev 2014-12-10 07:29:47 +00:00
Wink Saville
4d9749fd5d am 2f5cb843: am 6490d869: Merge "Add subId as parameter for get/setDataEnabled." into lmp-mr1-dev
* commit '2f5cb843553a596d314596c2bb776541db864d63':
  Add subId as parameter for get/setDataEnabled.
2014-12-09 18:06:03 +00:00
Wink Saville
6490d8694a Merge "Add subId as parameter for get/setDataEnabled." into lmp-mr1-dev 2014-12-09 17:52:27 +00:00
Jeff Sharkey
86af3b6061 am 2f1e953f: am 4df65bf1: Merge "Direct notification of network interface changes." into lmp-mr1-dev
* commit '2f1e953f8fd6d7ee32c00a680f887607f1005f62':
  Direct notification of network interface changes.
2014-12-09 00:18:01 +00:00
Jeff Sharkey
aa6ff6c7b0 Direct notification of network interface changes.
Connectivity broadcasts recently changed and are no longer sent for
certain types of network changes.  For example, when stacked network
interfaces change for a mobile network.  To ensure that we pick up
all these details, directly wire the two services together.

Also remove some unused code for split network types.

Bug: 18666753
Change-Id: I0467bd5b330c0e0cb51af2306d821b41ad16337a
2014-12-08 14:50:14 -08:00
Jeff Sharkey
3c18de21c7 am 5b41696c: am a8fb5803: Merge "Offer to "merge" subscribers for data usage." into lmp-mr1-dev
* commit '5b41696c56c124124d48168227a83b63bd55aea7':
  Offer to "merge" subscribers for data usage.
2014-12-08 19:44:27 +00:00
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
Jeff Sharkey
fffa983fe4 Offer to "merge" subscribers for data usage.
There are some cases where multiple subscriber identities (IMSI)
should be treated as "merged together" from a data usage
perspective.  This is done by extending the template used for
matching purposes to support multiple subscribers.

Then, when we query historical usage or set network policies, we
normalize the matching template to merge to any other identities
that should be included.  When normalizing, the "lowest" identity
is always used for equality and storage purposes, which allows
identities to come and go over time.

This change also fixes data usage recording for multi-SIM devices
by passing along the concrete subscriber identity for each network
interface.  Also correctly create default policies for multi-SIM
devices.  This change also drops setPolicyDataEnable() until it can
be wired up to the right underlying NetworkAgent.  (This means we
still bring up the network, and then rely on iptables rules to block
traffic when over the limit, instead of proactively disabling the
connection.)

Bug: 18012787
Change-Id: If6acf32009fdfea2b836f5aff8e2f3e5e0248b4a
2014-12-08 08:42:59 -08:00
Erik Kline
b883659514 Re-remove CONNECTIVITY_CHANGE_DELAY and supporting functions.
Since optimistic addresses are useable upon kernel notification
there is no need for this extra connectivity delay.

---

This functionality was originally submitted in ag/572619.  Owing
to issues with bind()ing to optimistic addresses (see b/18609055)
this was reverted in ag/598673.

This reverts the revert.  :-)

Bug: 17769720
Change-Id: Ibee490b2af72050693b6bd748193f51e312ca527
2014-12-08 16:25:20 +09: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
Wink Saville
689f70442c Add subId as parameter for get/setDataEnabled.
Bug: 18279333
Change-Id: I2496a2fd92b154e5e6981cbf6b5b5939cda59122
2014-12-05 11:10:30 -08: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