Commit Graph

2924 Commits

Author SHA1 Message Date
Erik Kline
7d211ae751 am c28e13c2: Merge "Don\'t lose critical success/failure messages" into mnc-dev
* commit 'c28e13c2cd8b80d49ee657f70edca3c99fd5e4a9':
  Don't lose critical success/failure messages
2015-06-25 05:17:10 +00:00
Erik Kline
c28e13c2cd Merge "Don't lose critical success/failure messages" into mnc-dev 2015-06-25 03:46:35 +00:00
Erik Kline
431daaac77 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
05c79770af am 8ab9cbd3: am 208b626e: am 350bee04: Use heads-up notifications when selecting networks with no Internet
* commit '8ab9cbd3ce1d3643f450801e991aafcea6e1946f':
  Use heads-up notifications when selecting networks with no Internet
2015-06-24 10:08:49 +00:00
Lorenzo Colitti
03308b9db9 am 350bee04: Use heads-up notifications when selecting networks with no Internet
* commit '350bee0406e73e09de92c87830bcffc28f4169f6':
  Use heads-up notifications when selecting networks with no Internet
2015-06-24 09:43:38 +00:00
Lorenzo Colitti
350bee0406 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
14949ac948 am 9d05553b: am ce5bcf8b: am 92bb3df5: Merge "Extend the time between WiFi energy samples" into mnc-dev
* commit '9d05553b07fe2ba3534e5f39372165c6f48b99a4':
  Extend the time between WiFi energy samples
2015-06-23 22:21:51 +00:00
Paul Jensen
9603d4e143 am 0a99ca6e: am daf6b73b: am 9065b810: Merge "Disallow requesting networks with mutable NetworkCapabilities." into mnc-dev
* commit '0a99ca6e3c15983e91273fbc1c109f84f25ea982':
  Disallow requesting networks with mutable NetworkCapabilities.
2015-06-23 21:31:00 +00:00
Paul Jensen
1a633d14a9 am 79437726: am afb94be6: am 28dd8c4a: Merge "Fix missing NetworkCallbacks for NET_CAPABILITY_VALIDATED changes" into mnc-dev
* commit '794377266121cafc365b8d284b06e03c593feeae':
  Fix missing NetworkCallbacks for NET_CAPABILITY_VALIDATED changes
2015-06-23 21:30:54 +00:00
Paul Jensen
b9068230a9 am d61c4289: am 6716e3db: am dafd5612: Merge "Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL" into mnc-dev
* commit 'd61c4289c964e78ec166d485cddbed06841ad33c':
  Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
2015-06-23 21:30:47 +00:00
Adam Lesinski
0aa80efc0f am 92bb3df5: Merge "Extend the time between WiFi energy samples" into mnc-dev
* commit '92bb3df50b76a74f09e8663396b44e30e609f297':
  Extend the time between WiFi energy samples
2015-06-23 21:22:37 +00:00
Adam Lesinski
92bb3df50b Merge "Extend the time between WiFi energy samples" into mnc-dev 2015-06-23 21:12:35 +00:00
Adam Lesinski
f9c93168dc 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
a0ef32ec3f 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
98f1ca875b 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
c8d300a039 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
Lorenzo Colitti
823f5396db am ba7ee88c: am acf761eb: am fd62bcfd: Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev
* commit 'ba7ee88cb78aee12e923a531f513d6d90965db7a':
  Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED.
2015-06-23 18:22:49 +00:00
Paul Jensen
ee52d2375f 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
c88b39b1d4 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
53f089581a Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94
2015-06-23 14:09:01 -04:00
Lorenzo Colitti
af9f765bc0 am fd62bcfd: Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev
* commit 'fd62bcfdca0d8cb81cc8303e2b933d1f9a84019c':
  Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED.
2015-06-23 14:52:47 +00:00
Lorenzo Colitti
fd62bcfdca Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev 2015-06-23 14:41:57 +00:00
Paul Jensen
21d4552247 am 07f2d1ad: am c1ff2c73: am 9ec5a554: Merge "Speed up network transition when WiFi disconnects" into mnc-dev
* commit '07f2d1ade33c07596b4b5a652235b7579ab848c3':
  Speed up network transition when WiFi disconnects
2015-06-20 05:43:57 +00:00
Paul Jensen
7bcdf28e50 am 2e2cc43e: am ae6d0354: am d44e4108: Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev
* commit '2e2cc43e3353ca433fc7f85521102cb138faeb65':
  Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)
2015-06-20 05:43:50 +00:00
Paul Jensen
16c60d66db am f58e1dd3: am 4a451de0: am a43bca83: Merge "Don\'t send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev
* commit 'f58e1dd34c5bca555673b08c0f3490c0328ba07a':
  Don't send spurious onAvailable NetworkCallbacks when rematching
2015-06-20 05:43:45 +00:00
Paul Jensen
8d96ebcfde am 9ec5a554: Merge "Speed up network transition when WiFi disconnects" into mnc-dev
* commit '9ec5a5541253a27e2b3cc67087a831c156605eaa':
  Speed up network transition when WiFi disconnects
2015-06-20 01:21:15 +00:00
Paul Jensen
0bfc1e2ed7 am d44e4108: Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev
* commit 'd44e41088dde84068270df3ec60f79403c8bb6f8':
  Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)
2015-06-20 01:21:10 +00:00
Paul Jensen
892300601d am a43bca83: Merge "Don\'t send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev
* commit 'a43bca8377b8ed96e6e56b6832611a73c078fda1':
  Don't send spurious onAvailable NetworkCallbacks when rematching
2015-06-20 01:21:04 +00:00
Paul Jensen
9ec5a55412 Merge "Speed up network transition when WiFi disconnects" into mnc-dev 2015-06-20 01:15:35 +00:00
Paul Jensen
621b1b743b 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
d44e41088d Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev 2015-06-20 01:13:18 +00:00
Paul Jensen
a43bca8377 Merge "Don't send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev 2015-06-20 01:12:20 +00:00
Paul Jensen
65a1adba2f Don't send spurious onAvailable NetworkCallbacks when rematching
Bug:21762680
Change-Id: Ia701045dffc666fe75fba0e1771872147e37179a
2015-06-19 00:06:57 +00:00
Paul Jensen
c8873fcfe5 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
6dbe7e6c98 am 0b8b1872: am 157cccef: am 3d54e672: Merge "Carefully select which DNS servers to send to netd" into mnc-dev
* commit '0b8b18721503d84104e1d6aaf69993f3b532a9fc':
  Carefully select which DNS servers to send to netd
2015-06-18 06:56:23 +00:00
Erik Kline
a13e82d771 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
0f0dbb8222 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
9facc78f66 am 79cd02c4: am 8235c839: am 278bc590: Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
* commit '79cd02c4b0ada6eff5979f0cd39f3799606ba9bb':
  Remove dead hidden ConnectivityManager and NetworkInfo APIs.
2015-06-16 22:03:06 +00:00
Paul Jensen
7418567b59 am 278bc590: Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
* commit '278bc59082828203df6c052999c2b7e30cdfd483':
  Remove dead hidden ConnectivityManager and NetworkInfo APIs.
2015-06-16 11:38:18 +00:00
Paul Jensen
278bc59082 Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev 2015-06-16 11:30:51 +00:00
Erik Kline
fdfd66c062 am 47585f46: am a01b9e6f: am e1ee8c66: Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev
* commit '47585f462a9cde661169b16cea870c05e91d92f8':
  Add a test that Network#getNetworkHandle() behaves sanely.
2015-06-16 04:17:27 +00:00
Erik Kline
682c093dba am e1ee8c66: Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev
* commit 'e1ee8c665f7eec15d863b6643870c1d6860ccb07':
  Add a test that Network#getNetworkHandle() behaves sanely.
2015-06-16 03:52:43 +00:00
Erik Kline
e1ee8c665f Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev 2015-06-16 03:43:56 +00:00
Paul Jensen
c6b3de1e4a 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
bad054a7bc am b379fdd0: am 49ab026a: am 5cc59014: Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev
* commit 'b379fdd0e9fa560e0abfe771acf920bb6aca60ad':
  Remove most sleep() calls from ConnectivityServiceTest
2015-06-15 14:11:20 +00:00
Paul Jensen
8a97666f03 am 5cc59014: Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev
* commit '5cc59014636a8e88427a8ea165f6208cc421e653':
  Remove most sleep() calls from ConnectivityServiceTest
2015-06-15 13:50:49 +00:00
Paul Jensen
5cc5901463 Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev 2015-06-15 13:35:48 +00:00
Erik Kline
cc00792876 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
197908c00c am 604f6cf1: am 63cae6c8: am 17de4b2a: Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev
* commit '604f6cf11307f1be19fad05c40482fd792ab3162':
  remove usage of deprecated method setLatestEventInfo
2015-06-12 20:05:49 +00:00
Chris Wren
12f9e13483 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