Commit Graph

2129 Commits

Author SHA1 Message Date
Erik Kline
a8df1ce59d am 8dbe37c6: Merge "Don\'t lose critical success/failure messages" into mnc-dev
* commit '8dbe37c6b5795a35413a0d1c1461184890bc3ba7':
  Don't lose critical success/failure messages
2015-06-25 05:17:10 +00:00
Erik Kline
8dbe37c6b5 Merge "Don't lose critical success/failure messages" into mnc-dev 2015-06-25 03:46:35 +00:00
Erik Kline
f5086144f3 Don't lose critical success/failure messages
Occasionally, "dumpsys connectivity --diag" will show measurement
results without success or failure messages.  Properly record the
error before decrementing the countdown latch.

Bug: 20733156
Change-Id: Ic654dedb753a65a96fe870f79fb296fbfc459fcb
2015-06-24 20:02:20 +09:00
Lorenzo Colitti
69e5cf5301 am 7f78b330: Use heads-up notifications when selecting networks with no Internet
* commit '7f78b330894a61ad602b5e28a4feb79e38366873':
  Use heads-up notifications when selecting networks with no Internet
2015-06-24 09:43:38 +00:00
Lorenzo Colitti
7f78b33089 Use heads-up notifications when selecting networks with no Internet
Currently, when connecting to a network that has a captive portal
or has no Internet access, we display a regular notification.
Because this notification is easy to miss, switch to using a
heads-up notification if the user just manually selected the
network. If the system connects automatically, continue to use a
regular notification.

Bug: 20081183
Change-Id: I7a988b2bddfe898a0d2607ad85a04b227d678469
2015-06-24 17:47:44 +09:00
Adam Lesinski
027324cc3d am f37606b6: Merge "Extend the time between WiFi energy samples" into mnc-dev
* commit 'f37606b6792bdfbb2e4631df205e5970e36051b4':
  Extend the time between WiFi energy samples
2015-06-23 21:22:37 +00:00
Adam Lesinski
f37606b679 Merge "Extend the time between WiFi energy samples" into mnc-dev 2015-06-23 21:12:35 +00:00
Adam Lesinski
994bd039e5 Extend the time between WiFi energy samples
With bursty WiFi traffic, we end up sampling the WiFi controller's
energy data quite a lot. Extend the timeout so that we sample
once there has been no activity for 15 seconds.

Note: Once the WiFi radio goes down after being active, it can come back and be
active in less than 15 seconds, which means we may sample twice quickly.

Bug:21478443
Change-Id: I99081b664f8a33fef734bc55eef4d33ac297e83a
2015-06-23 13:42:53 -07:00
Paul Jensen
f05d2d244c am 9065b810: Merge "Disallow requesting networks with mutable NetworkCapabilities." into mnc-dev
* commit '9065b810160e34ab4cf4613a5a3d7db69b94d453':
  Disallow requesting networks with mutable NetworkCapabilities.
2015-06-23 19:52:05 +00:00
Paul Jensen
15577f7852 am 28dd8c4a: Merge "Fix missing NetworkCallbacks for NET_CAPABILITY_VALIDATED changes" into mnc-dev
* commit '28dd8c4a29fddce5bd462834fbe641b40c906909':
  Fix missing NetworkCallbacks for NET_CAPABILITY_VALIDATED changes
2015-06-23 19:51:57 +00:00
Paul Jensen
22dc0b933c am dafd5612: Merge "Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL" into mnc-dev
* commit 'dafd561298c4162dd6d95a22334e4cd3988a8f84':
  Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
2015-06-23 19:51:52 +00:00
Paul Jensen
1fcbf9c581 Disallow requesting networks with mutable NetworkCapabilities.
It's not clear what it means to request a network with a mutable
NetworkCapability like NET_CAPABILITY_VALIDATED or
NET_CAPABILITY_CAPTIVE_PORTAL.  Presently requesting such a network
would fail in a number of different ways:
1. The NetworkFactories would fail to match the request against their
   filter which doesn't include stateful NetworkCapabilities.
2. If the NetworkFactories did match, they'd bring up networks to try
   and satisfy the requests, but the networks would not have any
   mutable NetworkCapabilities initially so they'd be reaped.
Because of these problems it's safest to simply disallow these
requests.

Bug: 21343774
Change-Id: I56303242b81d39b370b8d5d1e32059bfcfc25949
2015-06-23 14:13:10 -04:00
Paul Jensen
50f3877a7f Fix missing NetworkCallbacks for NET_CAPABILITY_VALIDATED changes
Without this fix if a listening NetworkRequest with NET_CAPABILITY_VALIDATED
is submitted after a network has been validated but failed the most recent
validation attempt, the NetworkRequest will never receive callbacks.

Bug: 21343774
Change-Id: I6fa6d563c9a6f278b20e645776b707559033b249
2015-06-23 14:11:44 -04:00
Paul Jensen
783c0e08b5 Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94
2015-06-23 14:09:01 -04:00
Lorenzo Colitti
51b41eb3f4 am 0c70acc7: Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev
* commit '0c70acc723a6d3216b8f7807e9a69eb1f65506eb':
  Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED.
2015-06-23 14:52:47 +00:00
Lorenzo Colitti
0c70acc723 Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev 2015-06-23 14:41:57 +00:00
Paul Jensen
525f2e9c0e am f0b91529: Merge "Speed up network transition when WiFi disconnects" into mnc-dev
* commit 'f0b915298c5f2b9a64bd72301d614c27ef37ce9c':
  Speed up network transition when WiFi disconnects
2015-06-20 01:21:15 +00:00
Paul Jensen
84751d29a1 am 313a8792: Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev
* commit '313a87923c751a9d048dee93128852ae804b5188':
  Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)
2015-06-20 01:21:10 +00:00
Paul Jensen
07d87e192c am 5409cae7: Merge "Don\'t send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev
* commit '5409cae737c150aa06ff128be5cbe8550e7141b1':
  Don't send spurious onAvailable NetworkCallbacks when rematching
2015-06-20 01:21:04 +00:00
Paul Jensen
f0b915298c Merge "Speed up network transition when WiFi disconnects" into mnc-dev 2015-06-20 01:15:35 +00:00
Paul Jensen
cd3af75294 Speed up network transition when WiFi disconnects
Before falling back to cellular we used to first delete all the
network routing tables and rules for WiFi.  This isn't necessary
and can take significant time as it requires a lot of netd
shelling out to ip and ip[6]tables to flush routes and remove
the incoming packet mark rule.  Instead have netd delete all the
network routing tables and rules after we've either fallen back
to cellular or at least kicked off a cellular connection attempt.

Bug: 21932815
Change-Id: Iabac4a8b962492682df3073cc41a12e35bc9f1bb
2015-06-20 01:15:20 +00:00
Paul Jensen
313a87923c Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev 2015-06-20 01:13:18 +00:00
Paul Jensen
5409cae737 Merge "Don't send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev 2015-06-20 01:12:20 +00:00
Paul Jensen
8e91d747da Don't send spurious onAvailable NetworkCallbacks when rematching
Bug:21762680
Change-Id: Ia701045dffc666fe75fba0e1771872147e37179a
2015-06-19 00:06:57 +00:00
Paul Jensen
9ceed863ea Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)
Without this API we're more or less encouraging apps to have long running
processes (battery draining) to receive NetworkCallbacks for the stateful
NetworkCapabilities NET_CAPABILITIES_VALIDATED and
NET_CAPABILITIES_CAPTIVE_PORTAL.  With this API they can instead using
PendingIntents which outlive their apps.

Bug: 21343774
Change-Id: I168d0ac3757729acf7ca5546079846f575a0eedd
2015-06-18 20:00:44 -04:00
Erik Kline
a6d95921f0 am 3d54e672: Merge "Carefully select which DNS servers to send to netd" into mnc-dev
* commit '3d54e672a58301ff60498fc7c57870d9bccd0e45':
  Carefully select which DNS servers to send to netd
2015-06-18 06:36:35 +00:00
Erik Kline
04270063ed Carefully select which DNS servers to send to netd
Select only DNS servers that:
    - are reachable, according to routes in the LinkProperties, AND

    - have a "suitable" source address in the LinkProperites, meaning:
        - IPv4 DNS server:
            - only if LinkProperties has any IPv4 address
        - IPv6 link-local DNS server:
            - only if the server has a scopeId set
            - assume for now that LinkProperties has a suitable
              link-local address
        - IPv6 non-link-local DNS server:
            - only if LinkProperties has a global, preferred IPv6 address

Bug: 19470192
Bug: 20733156
Change-Id: Ibd95f3f7b33a4fb6c36d1cea4adb63c99068f657
2015-06-18 14:50:21 +09:00
Paul Jensen
823b649cc1 am 7fb7a4b0: Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
* commit '7fb7a4b0f11451384d6dab341b9a408bba504234':
  Remove dead hidden ConnectivityManager and NetworkInfo APIs.
2015-06-16 11:38:18 +00:00
Paul Jensen
7fb7a4b0f1 Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev 2015-06-16 11:30:51 +00:00
Erik Kline
fa551efbb3 am 3482df75: Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev
* commit '3482df75b49ec9fac03ee55bb30389f78a92a748':
  Add a test that Network#getNetworkHandle() behaves sanely.
2015-06-16 03:52:43 +00:00
Erik Kline
3482df75b4 Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev 2015-06-16 03:43:56 +00:00
Paul Jensen
a34bbb4087 Remove dead hidden ConnectivityManager and NetworkInfo APIs.
- There are no callers of
  NetworkInfo.setIsConnectedToProvisioningNetwork(), so remove all the
  code that deals with mIsConnectedToProvisioningNetwork being true,
  including the two ConnectiviyManager APIs.
- There are no callers of
  ConnectivityManager.getMobileRedirectedProvisioningUrl(), so remove
  the code that reads this URL.
- There are no callers of
  ConnectivityManager.captivePortalCheckCompleted(), so remove this
  API which is currently a no-op.

Change-Id: Ifa44c7553c7c45ebe261a2a124d9bf8d6f96c690
2015-06-16 02:07:36 +00:00
Paul Jensen
60403cd219 am f0b50db7: Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev
* commit 'f0b50db7a14690d7f8e276ae201a0674c5506945':
  Remove most sleep() calls from ConnectivityServiceTest
2015-06-15 13:50:49 +00:00
Paul Jensen
f0b50db7a1 Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev 2015-06-15 13:35:48 +00:00
Erik Kline
b43e6aba46 Add a test that Network#getNetworkHandle() behaves sanely.
Additionally:
    - make zero more obvious for debugging, rather than emitting
      some inscrutable magic value.

Bug: 19537384
Change-Id: Iac9a3297a0dda1ba3d69fd01cf6de81f01fd837e
2015-06-15 15:18:38 +09:00
Chris Wren
c2dbadfbba am 17de4b2a: Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev
* commit '17de4b2a73996366ff3d7759793a6809654caebe':
  remove usage of deprecated method setLatestEventInfo
2015-06-12 19:40:13 +00:00
Paul Jensen
8cf812fa91 Remove most sleep() calls from ConnectivityServiceTest
Change-Id: I90d2f6811ed1cb84614101200ac377e920bd864a
2015-06-12 10:31:09 -04:00
Chris Wren
250d51bdf7 remove usage of deprecated method setLatestEventInfo
Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
2015-06-12 10:16:04 -04:00
Robert Greenwalt
30fe9b0937 am 53aae402: Merge "Remove network requests properly." into mnc-dev
* commit '53aae402a09df100ea0ffd8f3fba2aca9107271b':
  Remove network requests properly.
2015-06-11 15:56:23 +00:00
Paul Jensen
1f93cee746 am 5ab230b6: Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev
* commit '5ab230b6ce3ec6868070b12669e23e365520c476':
  Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs
2015-06-11 14:52:57 +00:00
Lorenzo Colitti
4e30ffc03f am 8e22a868: Merge "When no Internet access is detected, display a notification first." into mnc-dev
* commit '8e22a868afc178b410e4dc98d59a01bb5040c3b0':
  When no Internet access is detected, display a notification first.
2015-06-11 14:50:30 +00:00
Lorenzo Colitti
a04936a001 Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED.
The API review comments in http://b/21343774 point out that the
suggested use case for onPreCheck (captive portal login apps) is
not a good use case as it requires that the app always be
running.

Also, unhide NET_CAPABILITY_VALIDATED, which is useful to apps
that want to detect captive portals and network connectivity
failures.

Bug: 21343774
Change-Id: Iad7c839bcc136b0fa9581dccc5fd97a28efed4ab
2015-06-11 15:30:13 +09:00
Robert Greenwalt
53aae402a0 Merge "Remove network requests properly." into mnc-dev 2015-06-11 02:19:17 +00:00
Robert Greenwalt
a89f8f1309 Remove network requests properly.
We used to only remove requests that we'd acted on but that's
just wrong.

Also adds test case which exposed the problem but passes with the fix.

bug:20731384
Change-Id: I581a005560cc71167b857abf2452769399a9e1b7
2015-06-10 14:44:34 -07:00
Paul Jensen
5ab230b6ce Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev 2015-06-10 17:59:54 +00:00
Paul Jensen
a02ec16011 Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs
Overlapping the NetIDs can cause the ConnectivityService instance under test
to inadvertently use real networks, for example when NetworkMonitor attempts
to validate a network.  This fixes test hangs when run on devices with
active internet connections.

Change-Id: I5e1898953f0117b9f75beccac4a52ae2db173567
2015-06-10 11:30:26 -04:00
Lorenzo Colitti
8e22a868af Merge "When no Internet access is detected, display a notification first." into mnc-dev 2015-06-10 15:25:31 +00:00
Lorenzo Colitti
37a4d553dd When no Internet access is detected, display a notification first.
Previously, we displayed a dialog on top of whatever the user was
doing. Instead, display a notification that can take the user to
the dialog.

Because the notification is less intrusive, also enable it even
if the network without Internet access is already the system
default network. Previously we did not do this because in that
case the user might not have other useful options, and thus a
dialog would have been too intrusive.

Bug: 20081183
Bug: 20538448
Change-Id: I677be238d675c13a13dc0bae2dbb37cbe4f52cb6
2015-06-10 23:37:00 +09:00
Erik Kline
564601c733 am be74d7ce: Merge "initial revision of NetworkDiagnostics" into mnc-dev
* commit 'be74d7ce4f0865d7d4fbb1917bb980371b62f330':
  initial revision of NetworkDiagnostics
2015-06-09 23:35:33 +00:00
Robin Lee
a35d5126d2 am 87a4c869: Merge "Switch over to updated VPN warning strings" into mnc-dev
* commit '87a4c8693d66f6bd99620ffaabf3c50a6ac56a71':
  Switch over to updated VPN warning strings
2015-06-09 23:25:07 +00:00