Commit graph

13,045 commits

Message SHA1
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
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

Erik Kline   authored and   Android Git Automerger   commited 2015-06-18 06:56:23 +00:00
9b11d8386a
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

Erik Kline   authored and   Android Git Automerger   commited 2015-06-18 06:36:35 +00:00
a6d95921f0
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
am 79cd02c4: am 8235c839: am 7fb7a4b0: Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
* commit '79cd02c4b0ada6eff5979f0cd39f3799606ba9bb':
  Remove dead hidden ConnectivityManager and NetworkInfo APIs.

Paul Jensen   authored and   Android Git Automerger   commited 2015-06-16 22:03:06 +00:00
68fb206ab4
am 7fb7a4b0: Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
* commit '7fb7a4b0f1':
  Remove dead hidden ConnectivityManager and NetworkInfo APIs.

Paul Jensen   authored and   Android Git Automerger   commited 2015-06-16 11:38:18 +00:00
823b649cc1
Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-16 11:30:51 +00:00
7fb7a4b0f1
am 47585f46: am a01b9e6f: am 3482df75: Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev
* commit '47585f462a9cde661169b16cea870c05e91d92f8':
  Add a test that Network#getNetworkHandle() behaves sanely.

Erik Kline   authored and   Android Git Automerger   commited 2015-06-16 04:17:27 +00:00
b082f78973
am 3482df75: Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev
* commit '3482df75b4':
  Add a test that Network#getNetworkHandle() behaves sanely.

Erik Kline   authored and   Android Git Automerger   commited 2015-06-16 03:52:43 +00:00
fa551efbb3
Merge "Add a test that Network#getNetworkHandle() behaves sanely." into mnc-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2015-06-16 03:43:56 +00:00
3482df75b4
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
am b379fdd0: am 49ab026a: am f0b50db7: Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev
* commit 'b379fdd0e9fa560e0abfe771acf920bb6aca60ad':
  Remove most sleep() calls from ConnectivityServiceTest

Paul Jensen   authored and   Android Git Automerger   commited 2015-06-15 14:11:20 +00:00
18c01ee7fd
am f0b50db7: Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev
* commit 'f0b50db7a1':
  Remove most sleep() calls from ConnectivityServiceTest

Paul Jensen   authored and   Android Git Automerger   commited 2015-06-15 13:50:49 +00:00
60403cd219
Merge "Remove most sleep() calls from ConnectivityServiceTest" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-15 13:35:48 +00:00
f0b50db7a1
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

Erik Kline   commited 2015-06-15 15:18:38 +09:00
b43e6aba46
am 604f6cf1: am 63cae6c8: am 17de4b2a: Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev
* commit '604f6cf11307f1be19fad05c40482fd792ab3162':
  remove usage of deprecated method setLatestEventInfo

Chris Wren   authored and   Android Git Automerger   commited 2015-06-12 20:05:49 +00:00
1eb56d111a
am 17de4b2a: Merge "remove usage of deprecated method setLatestEventInfo" into mnc-dev
* commit '17de4b2a73996366ff3d7759793a6809654caebe':
  remove usage of deprecated method setLatestEventInfo

Chris Wren   authored and   Android Git Automerger   commited 2015-06-12 19:40:13 +00:00
c2dbadfbba
Remove most sleep() calls from ConnectivityServiceTest
Change-Id: I90d2f6811ed1cb84614101200ac377e920bd864a

Paul Jensen   commited 2015-06-12 10:31:09 -04:00
8cf812fa91
remove usage of deprecated method setLatestEventInfo
Bug: 18510449
Change-Id: I56a77991c729990e501f402e007dfa79ee57621e

Chris Wren   commited 2015-06-12 10:16:04 -04:00
250d51bdf7
am 53aae402: Merge "Remove network requests properly." into mnc-dev
* commit '53aae402a0':
  Remove network requests properly.

Robert Greenwalt   authored and   Android Git Automerger   commited 2015-06-11 15:56:23 +00:00
30fe9b0937
am 5ab230b6: Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev
* commit '5ab230b6ce':
  Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs

Paul Jensen   authored and   Android Git Automerger   commited 2015-06-11 14:52:57 +00:00
1f93cee746
am 8e22a868: Merge "When no Internet access is detected, display a notification first." into mnc-dev
* commit '8e22a868af':
  When no Internet access is detected, display a notification first.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-06-11 14:50:30 +00:00
4e30ffc03f
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

Lorenzo Colitti   commited 2015-06-11 15:30:13 +09:00
a04936a001
am c2a3f75f: am 1ec7d05e: am 53aae402: Merge "Remove network requests properly." into mnc-dev
* commit 'c2a3f75fb60a4a720f07791cfe0730f42cd8eb80':
  Remove network requests properly.

Robert Greenwalt   authored and   Android Git Automerger   commited 2015-06-11 05:55:20 +00:00
ac7b636ed5
Merge "Remove network requests properly." into mnc-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2015-06-11 02:19:17 +00:00
53aae402a0
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

Robert Greenwalt   commited 2015-06-10 14:44:34 -07:00
a89f8f1309
am c05c31a4: am 0fac11a8: am 5ab230b6: Merge "Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs" into mnc-dev
* commit 'c05c31a4c684f15bacd1908737bf8148d0e6adb3':
  Avoid overlapping NetIDs in ConnectivityServiceTest with real NetIDs

Paul Jensen   authored and   Android Git Automerger   commited 2015-06-10 18:42:59 +00:00
597c26e590
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
am bb2f798a: am 1f91eed0: am 8e22a868: Merge "When no Internet access is detected, display a notification first." into mnc-dev
* commit 'bb2f798ae19cb7ef928274972ca9ad6c2c2c7eff':
  When no Internet access is detected, display a notification first.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-06-10 17:13:22 +00:00
3e50d389ad
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
am baad4077: am 69b0dcab: am be74d7ce: Merge "initial revision of NetworkDiagnostics" into mnc-dev
* commit 'baad4077955905933b9b5a8cdd6e82349cc68c96':
  initial revision of NetworkDiagnostics

Erik Kline   authored and   Android Git Automerger   commited 2015-06-10 00:00:10 +00:00
3850aa3871
am e26ae30e: am 9e46757d: am 87a4c869: Merge "Switch over to updated VPN warning strings" into mnc-dev
* commit 'e26ae30eeedd8145a021697e9b7e18bb740537c7':
  Switch over to updated VPN warning strings

Robin Lee   authored and   Android Git Automerger   commited 2015-06-09 23:40:57 +00:00
c44496ae12
am be74d7ce: Merge "initial revision of NetworkDiagnostics" into mnc-dev
* commit 'be74d7ce4f':
  initial revision of NetworkDiagnostics

Erik Kline   authored and   Android Git Automerger   commited 2015-06-09 23:35:33 +00:00
564601c733
am 87a4c869: Merge "Switch over to updated VPN warning strings" into mnc-dev
* commit '87a4c8693d':
  Switch over to updated VPN warning strings

Robin Lee   authored and   Android Git Automerger   commited 2015-06-09 23:25:07 +00:00
a35d5126d2
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
am b3cc45a1: am b99a1ac6: am 1162744f: Merge "Make public Network#bindSocket(FileDescriptor)." into mnc-dev
* commit 'b3cc45a1f53a6a88a736004c553ce417596bb440':
  Make public Network#bindSocket(FileDescriptor).

Erik Kline   authored and   Android Git Automerger   commited 2015-06-09 13:17:03 +00:00
2df15374cb
am 1162744f: Merge "Make public Network#bindSocket(FileDescriptor)." into mnc-dev
* commit '1162744fedbd35f3999221cc9abc4caa3204a4b2':
  Make public Network#bindSocket(FileDescriptor).

Erik Kline   authored and   Android Git Automerger   commited 2015-06-09 07:56:58 +00:00
a654a1cc77
Make public Network#bindSocket(FileDescriptor).
Code that uses android.system.Os to create sockets as FileDescriptors
should be able to bind them to networks.  Note that FileDescriptors
could already be marked as "protected from VPNs" via
NetworkUtils#protectFromVpn(), but heretofore were not easily bound
to any particular network.

Bug: 21449922
Change-Id: I4bb86db5d95d5a55bb2d7e245848d11eaa351e65

Erik Kline   commited 2015-06-09 16:19:24 +09:00
84da63c88e
am 0172266b: am 1ad2c080: am 223ab404: Merge "Remove "returning Blocked NetworkInfo" logspam." into mnc-dev
* commit '0172266ba772c4b00f96bf40bf18cf245e35d8bc':
  Remove "returning Blocked NetworkInfo" logspam.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-06-05 09:37:42 +00:00
443576db4f
am 223ab404: Merge "Remove "returning Blocked NetworkInfo" logspam." into mnc-dev
* commit '223ab40466':
  Remove "returning Blocked NetworkInfo" logspam.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-06-05 08:02:55 +00:00
c0a00731cd
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