Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
Merge "Disable WiFi autojoin when user decides via "Stay connected?" dialog" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-29 13:52:02 +00:00
951aabb4a7
Always check off-link connectivity in NetworkDiagnostics.
Currently, NetworkDiagnostics only checks off-link connectivity if
one of the DNS servers is off-link. Make it check off-link
connectivity in all cases by sending probes to Google Public DNS
if off-link DNS servers are not specified.

Bug: 22569331
Bug: 22641669
Bug: 22748900
Change-Id: I6cb0dd8491bc0c1a488631deca56722b9c1d2b3f

Lorenzo Colitti   commited 2015-07-27 16:41:44 +09:00
994ba7343f
Disable WiFi autojoin when user decides via "Stay connected?" dialog
If the user selects "No" in the "Stay connected?" dialog box:
1. Disable autojoining that network in the future, and
2. Disassociate from that network.

Bug:22187193
Change-Id: I14dc9236c57e3ab7d3ec95edc906787cbfbf3c9f

Paul Jensen   commited 2015-07-16 14:41:18 +00:00
4afac2378d
Merge "Log NetworkRequestInfo to get more detailed history" into mnc-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2015-07-14 04:09:29 +00:00
c2ce3ff6dd
Log NetworkRequestInfo to get more detailed history
Bug: 21641983
Bug: 22235775
Bug: 22299819
Bug: 22358164
Change-Id: I48a2d162dd499a3590f06d805267a63822856969

Erik Kline   commited 2015-07-14 11:46:51 +09:00
47401fa30e
Fix filter on CONNECTIVITY_ACTION updates
Only send for network types which the network supports.

bug:22411968
Change-Id: I97765544eb653caf0ea4fc5d3feec5742d5d88dc

Robert Greenwalt   commited 2015-07-10 16:26:40 -07:00
dd1e223ce9
Merge "Legacy VPN calls to require a userID" into mnc-dev
Robin Lee   authored and   Android (Google) Code Review   commited 2015-07-10 19:05:38 +00:00
90a455062e
Fix build break.
Automatic merge commit caused breakage due to someone else's
intervening change adding a call site of a function whose last
parameter I removed.  Function in question is
ConnectivityService.rematchAllNetworksAndRequests.
Changes that merged badly are ece7dfa and 41c19a0.

Change-Id: I8fd32e1a187236a65c1b7c0ecdf17b817d108fd0

Paul Jensen   commited 2015-07-10 12:29:23 -04:00
823ea71ef3
Merge "Fallback to Cellular if WiFi fails to validate" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-10 15:51:38 +00:00
9eb4dd2df9
Merge "Prepare some ConnectivityService logic for fallback to Cellular change" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-10 15:51:23 +00:00
36d8b23b1e
Merge "Add android.net.CaptivePortal class for captive-portal-handling-app callbacks" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-10 14:57:13 +00:00
86599d6a2a
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

Paul Jensen   commited 2015-07-09 10:47:34 -04:00
4173cceaea
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

Paul Jensen   commited 2015-07-09 10:26:17 -04:00
25eb5fd97e
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

Paul Jensen   commited 2015-07-09 10:26:08 -04:00
ece7dfac67
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

Robert Greenwalt   commited 2015-07-08 20:42:55 -07:00
41c19a021d
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

Robin Lee   commited 2015-07-07 19:37:21 +00:00
466997fec7
Merge "Don't reevaluate disconnected networks" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-30 11:11:14 +00:00
89a3e1bbb3
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

Erik Kline   commited 2015-06-30 12:12:37 +09:00
1c8fab54bd
Merge "Add Validation logging." into mnc-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2015-06-26 22:40:31 +00:00
b6e69b8c80
Add Validation logging.
Persist the last 20 lines of validation info for the last 10
networks.

bug: 21599856
Change-Id: I8124480cc9181eea2adb7eb6eabcd07c9506b6d3

Robert Greenwalt   commited 2015-06-26 11:12:39 -07:00
2784ed6559
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

Paul Jensen   commited 2015-06-26 11:56:33 -04:00
773f4f38a0
Merge "Don't lose critical success/failure messages" into mnc-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2015-06-25 03:46:35 +00:00
8dbe37c6b5
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

Erik Kline   commited 2015-06-24 20:02:20 +09:00
f5086144f3
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

Lorenzo Colitti   commited 2015-06-24 17:47:44 +09:00
7f78b33089
Merge "Extend the time between WiFi energy samples" into mnc-dev
Adam Lesinski   authored and   Android (Google) Code Review   commited 2015-06-23 21:12:35 +00:00
f37606b679
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

Adam Lesinski   commited 2015-06-23 13:42:53 -07:00
994bd039e5
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

Paul Jensen   commited 2015-06-23 14:13:10 -04:00
1fcbf9c581
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

Paul Jensen   commited 2015-06-23 14:11:44 -04:00
50f3877a7f
Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94

Paul Jensen   commited 2015-06-23 14:09:01 -04:00
783c0e08b5
Merge "Speed up network transition when WiFi disconnects" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-20 01:15:35 +00:00
f0b915298c
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

Paul Jensen   commited 2015-06-20 01:15:20 +00:00
cd3af75294
Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-20 01:13:18 +00:00
313a87923c
Merge "Don't send spurious onAvailable NetworkCallbacks when rematching" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-20 01:12:20 +00:00
5409cae737
Don't send spurious onAvailable NetworkCallbacks when rematching
Bug:21762680
Change-Id: Ia701045dffc666fe75fba0e1771872147e37179a

Paul Jensen   commited 2015-06-19 00:06:57 +00:00
8e91d747da
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

Paul Jensen   commited 2015-06-18 20:00:44 -04:00
9ceed863ea
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

Erik Kline   commited 2015-06-18 14:50:21 +09:00
04270063ed
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

Paul Jensen   commited 2015-06-16 02:07:36 +00:00
a34bbb4087
remove usage of deprecated method setLatestEventInfo
Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e

Chris Wren   commited 2015-06-12 10:16:04 -04:00
250d51bdf7
Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-10 17:59:54 +00:00
5ab230b6ce
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

Paul Jensen   commited 2015-06-10 11:30:26 -04:00
a02ec16011
Merge "When no Internet access is detected, display a notification first." into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-06-10 15:25:31 +00:00
8e22a868af
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

Lorenzo Colitti   commited 2015-06-10 23:37:00 +09:00
37a4d553dd
Merge "initial revision of NetworkDiagnostics" into mnc-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2015-06-09 23:23:03 +00:00
be74d7ce4f
Merge "Switch over to updated VPN warning strings" into mnc-dev
Robin Lee   authored and   Android (Google) Code Review   commited 2015-06-09 23:13:38 +00:00
87a4c8693d
Switch over to updated VPN warning strings
These are more consistent and have placeholders for the description of
whatever VPN apps are actually active.

Bug: 20516964
Bug: 17474682
Change-Id: I37ff287b795f10bbbb192540f09f8100bb27b1a0

Robin Lee   commited 2015-06-09 12:04:23 -07:00
e2dea8e9c6
initial revision of NetworkDiagnostics
Bug: 21449922
Change-Id: I6a66cfa98601d6ccfe38ff840b0dd49ed1538a41

Erik Kline   commited 2015-06-09 23:37:58 +09:00
445cad129e
Merge "Remove "returning Blocked NetworkInfo" logspam." into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-06-05 07:50:44 +00:00
223ab40466
Remove "returning Blocked NetworkInfo" logspam.
Bug: 20006730
Change-Id: I2061127e3c7283c0a4899940d3fc224ca114f754

Lorenzo Colitti   commited 2015-06-05 10:58:17 +09:00
28ad516437
Merge "Fix the empty reason field in connectivity change intent." into mnc-dev
Feixiong Zhang   authored and   Android (Google) Code Review   commited 2015-06-04 18:54:49 +00:00
bf546dc592
Fix the empty reason field in connectivity change intent.
The code set it to null instead of info.getReason.

Change-Id: I1b26ad040c23da7080dbfaeb5376181998115805

Feixiong Zhang   commited 2015-06-04 11:38:41 -07:00
ac21bfa9c7