Commit Graph

2134 Commits

Author SHA1 Message Date
Erik Kline
f8147b34d7 am 5f950417: Merge "Fix use of reachable DNS server logic" into mnc-dev
* commit '5f950417f63718880e0cc14a1a5865106b2fe551':
  Fix use of reachable DNS server logic
2015-06-30 06:43:04 +00:00
Erik Kline
a923dbae3a Fix use of reachable DNS server logic
Move reachable DNS server computation out of ConnectivityService
and split it into LinkProperties#isReachable() and a companion
change in WifiStateMachine's makeLinkProperties().

Restore previous ConnectivityService#updateDnses() behaviour, as
the pruning is done in WifiStateMachine now.

Bug: 19470192
Bug: 20733156
Bug: 22098233
Change-Id: I810ef74d504e5dc1ca2017d435cdadd6b82171e6
2015-06-30 12:12:37 +09:00
Robert Greenwalt
e735d3bd99 am fafc8fef: Merge "Add Validation logging." into mnc-dev
* commit 'fafc8fef0ce78c08fd453a18ecd1ccb9c794ca1f':
  Add Validation logging.
2015-06-26 22:45:08 +00:00
Robert Greenwalt
fafc8fef0c Merge "Add Validation logging." into mnc-dev 2015-06-26 22:40:31 +00:00
Robert Greenwalt
27ff774f30 Add Validation logging.
Persist the last 20 lines of validation info for the last 10
networks.

bug: 21599856
Change-Id: I8124480cc9181eea2adb7eb6eabcd07c9506b6d3
2015-06-26 11:12:39 -07:00
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
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
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
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
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
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
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
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
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
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
Paul Jensen
f98df17f98 Remove most sleep() calls from ConnectivityServiceTest
Change-Id: I90d2f6811ed1cb84614101200ac377e920bd864a
2015-06-12 10:31:09 -04:00
Chris Wren
cb43350ffd remove usage of deprecated method setLatestEventInfo
Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e
2015-06-12 10:16:04 -04:00
Robert Greenwalt
df7f5bfb61 am ddb3d3aa: Merge "Remove network requests properly." into mnc-dev
* commit 'ddb3d3aaccfed319c473d5738a106ee4e0da34e9':
  Remove network requests properly.
2015-06-11 15:56:23 +00:00
Paul Jensen
bcf1ce158a am 69f4bb15: Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev
* commit '69f4bb15a964dbcd301287d5ac36a68c17361c98':
  Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs
2015-06-11 14:52:57 +00:00
Lorenzo Colitti
4688180ef9 am ccd85f3e: Merge "When no Internet access is detected, display a notification first." into mnc-dev
* commit 'ccd85f3e29cb247393a7ffa513f30553c5c9b3aa':
  When no Internet access is detected, display a notification first.
2015-06-11 14:50:30 +00:00
Lorenzo Colitti
3a9df1a8cd 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
ddb3d3aacc Merge "Remove network requests properly." into mnc-dev 2015-06-11 02:19:17 +00:00
Robert Greenwalt
8d2cfc2253 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
69f4bb15a9 Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev 2015-06-10 17:59:54 +00:00