Commit Graph

2499 Commits

Author SHA1 Message Date
Robert Greenwalt
b2fbd1a5d6 am 30d822e2: am b091695b: Merge "Revive NetworkInfo\'s SUSPENDED state." into mnc-dev
* commit '30d822e2bdfde4360fc072f7f4ee16c83ac9dcc8':
  Revive NetworkInfo's SUSPENDED state.
2015-07-09 20:13:59 +00:00
Robert Greenwalt
f19cb714e4 am c3ed104c: am 49a8822d: am 8d6620bd: am 30d822e2: am b091695b: Merge "Revive NetworkInfo\'s SUSPENDED state." into mnc-dev
* commit 'c3ed104c25621dce3bbb50fe28e0bf9923307721':
  Revive NetworkInfo's SUSPENDED state.
2015-07-09 19:12:20 +00:00
Paul Jensen
75e0adb220 Add android.net.CaptivePortal class for captive-portal-handling-app callbacks
This new class replaces the awkward string token and ConnectivityManager APIs
used by apps handling captive portals.

Bug:21343774
Change-Id: I1a2c69edb17322715bf8422bb4216b0ea60bfd59
2015-07-09 10:47:34 -04:00
Paul Jensen
de49eb18c6 Fallback to Cellular if WiFi fails to validate
Previously, once a network validated, for the purposes of comparing networks
to select the default network, we always considered it validated.
With this change if a network later fails to validate, we'll take this latest
validation result into account.  This means if WiFi and cellular are up
(e.g. if we recently switched from cellular->WiFi, and cellular is now
lingering) and both are validated, but for some reason WiFi fails a validation,
cellular will become the default network connection.

Bug:20896761
Change-Id: I858aa10c1aaec5cd9032067f960963409107bdb1
2015-07-09 10:26:17 -04:00
Paul Jensen
d2a43f9b6d Prepare some ConnectivityService logic for fallback to Cellular change
Reduce the duplication of some logic so when falling back to Cellular
when WiFi fails to validate is enabled, there's less chance for bugs
and failures:
1. De-duplicate several Network vs NetworkRequest matching functions
2. Remove the very tricky nascent logic by adding a simple "lingering" bit.

Bug:20896761
Change-Id: I21da9e827eec9cfd6835fcaa650192b9186ed053
2015-07-09 10:26:08 -04:00
Robert Greenwalt
7fb8adcd51 Revive NetworkInfo's SUSPENDED state.
This got lost in the multinetwork work for L.  It means
that if telephony stops having the ability to pass packets for a while
the rest of the platform doesn't know.

Telephony enters the suspended state if it enters a telephony call
while using certain radio access technologies, or if it switches to
one of those RATs while in a call.  It also can enter this state if
it temporarily loses contact with the network - the modem will
not report the loss of the data call for an indeterminant time in
the hope that regaining the network will restore the connection
without harm to any ongoing ip layer interactions.  For example
passing through a tunnel or taking an elevator trip may use this
mechanism.

bug: 19637156
Change-Id: If9fde68175e8561c19323c81fbfcb02a6e5a00fb
2015-07-08 20:42:55 -07:00
Lorenzo Colitti
98a4c4d25b Support NetworkCallbacks based on signal strength.
Bug: 21405941
Change-Id: I2ed8a5aeb8dac464a4305671ed22abcacb485bc9
2015-07-09 03:34:25 +09:00
Lorenzo Colitti
493910ac44 ConnectivityManager API for for packet keepalives.
Bug: 21405946
Change-Id: Ie1f8f8bee684fe2bb1092a9f1bc9f5dc29b1defc
2015-07-09 03:34:24 +09:00
Lorenzo Colitti
696a214258 Make immutable NetworkCapabilities more explicit.
Bug: 21405941
Change-Id: Iafd738c31747b0f5f9356bed1c97f5f282830af1
2015-07-09 03:34:24 +09:00
Robin Lee
35ca2e7768 Legacy VPN calls to require a userID
This way, system applications with INTERACT_ACROSS_USERS permission will
be able to fetch the information they need.

Pre-requisite for bug 21499103

Change-Id: I7e759d5039ae6e85abc6435049016b1dcaabc834
2015-07-07 19:37:21 +00:00
Paul Jensen
8e6e66dfec am 5973eb48: am bf816248: am e51c46b0: Merge "Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API" into mnc-dev
* commit '5973eb48220e1e44a4a3192cd9740fe8b47f8a3a':
  Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API
2015-07-03 05:35:58 +00:00
Paul Jensen
cb9c502cdb am e51c46b0: Merge "Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API" into mnc-dev
* commit 'e51c46b0683114d0aa9010a45ec0443505a0b389':
  Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API
2015-07-01 16:28:56 +00:00
Paul Jensen
169f662203 Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API
This better pairs up with
registerNetworkCallback(NetworkRequest, PendingIntent).

Bug:22175708
Change-Id: I336df3f48a0b814f1cbeba6d00afc4e6cc536483
2015-06-30 14:29:18 -04:00
Paul Jensen
6181a88767 am 2d72041d: am 013275d5: am 0a1bac88: Merge "Don\'t reevaluate disconnected networks" into mnc-dev
* commit '2d72041d47faa6718a7a0ec0b9b9b9b75757651b':
  Don't reevaluate disconnected networks
2015-06-30 11:44:49 +00:00
Paul Jensen
4a9a3f9994 am 0a1bac88: Merge "Don\'t reevaluate disconnected networks" into mnc-dev
* commit '0a1bac889906c4b8ae335d5e1fb845eaa1f44efb':
  Don't reevaluate disconnected networks
2015-06-30 11:21:23 +00:00
Paul Jensen
0a1bac8899 Merge "Don't reevaluate disconnected networks" into mnc-dev 2015-06-30 11:11:14 +00:00
Erik Kline
d9357398c4 am f2a08d05: am 49aeed9f: am 5f950417: Merge "Fix use of reachable DNS server logic" into mnc-dev
* commit 'f2a08d054cdc301eb66c957f9ae05307d1e1f215':
  Fix use of reachable DNS server logic
2015-06-30 07:06:06 +00:00
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
1c673d5f56 am 07fae068: am b3fcf1af: am fafc8fef: Merge "Add Validation logging." into mnc-dev
* commit '07fae068d3edc7b265f47c8340dfa105064c09fc':
  Add Validation logging.
2015-06-26 23:13:15 +00: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
Paul Jensen
3c3c6e8c40 Don't reevaluate disconnected networks
This serves no purpose and adds several log messages every time a
network disconnects.  The extra log messages contribute to
NetworkMonitor's chatty-ness and towards it getting muted.

Bug:21480101
Change-Id: I372f9939c534f77b052a15fdb2cd5288d19ddbab
2015-06-26 11:56:33 -04:00
Erik Kline
a06f5c0b2b am 00d28aee: am 2800c9fd: am c28e13c2: Merge "Don\'t lose critical success/failure messages" into mnc-dev
* commit '00d28aee898cf50530b61d099228745f674fa8da':
  Don't lose critical success/failure messages
2015-06-25 05:35:55 +00: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
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