Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
NetworkDiagnostics: ping default router from all global addreses.
This will hopefully allow us to determine if the router does not
have our global addresses in its neighbour cache.

Bug: 23661687
Change-Id: I46734c3c719003939cfccf038457ec309a9ff967

Lorenzo Colitti   commited 2015-09-10 15:49:54 +09:00
db30ceba87
Require the new PACKET_KEEPALIVE_OFFLOAD permission.
Bug: 23884210
Change-Id: I50a1a647a69deaba92e73021ee7d6cc0f3eb1eee

Lorenzo Colitti   commited 2015-09-09 00:16:57 +09:00
520287e881
Fix bugs and crashes in PacketKeepalive API.
Bug: 22606153
Bug: 23820819
Bug: 23884210
Change-Id: I1bf82094ec664baed345e9fb137fada0cbf4b7a0

Lorenzo Colitti   commited 2015-09-09 00:16:56 +09:00
f99389f155
Add tests for the PacketKeepalive API.
This currently fails in many different ways, but it tells us what
to fix.

Bug: 22606153
Bug: 23884210
Change-Id: If2e5ee0a8d7b26cad67d3d566ed5b1383e0db096

Lorenzo Colitti   commited 2015-09-09 00:16:56 +09:00
b793d607a5
Get rid of shortSleep() in ConnectivityServiceTest.
Instead, use IdleHandler to wait for things to become idle.

Bug: 22606153
Change-Id: Ic6ab93ad4d336b40962f9be1096629a44b63ee2f

Lorenzo Colitti   commited 2015-09-08 16:41:47 +09:00
1b8b5cdfad
Cut down some logs.
bug:23623327
Change-Id: I737d4e6c384bf4da62c65ad2abe0c9b5dca0067a

Robert Greenwalt   commited 2015-09-03 17:53:42 -07:00
9b33077561
Add SUPL-specific network bcast
Move SUPL CONNECTIVITY_ACTION bcasts to a different, hidden intent
to reduce the churn of apps when SUPL comes/goes.

Short term hack until SUPL moves to use the new APIs and there's
no bcast.

bug:23350688
Change-Id: I3dc14b42afa72465260aa41ccedfe1df27baabd9

Robert Greenwalt   commited 2015-09-01 15:06:04 -07:00
e577c8181d
am 886e7a63: Merge "Change default cellular activity timeout to 10" into mnc-dev
* commit '886e7a63b122a30c69c663d32e3e5f880a07593e':
  Change default cellular activity timeout to 10

Adam Lesinski   authored and   Android Git Automerger   commited 2015-08-19 00:53:35 +00:00
01ed50f414
Change default cellular activity timeout to 10
LTE radios take 10 seconds to power down, so we should set the
activity timeout to 10 seconds.

Bug:23294704
Change-Id: I7478b77f134b0fe2d82e39acd5c370add12735ca

Adam Lesinski   commited 2015-08-18 11:47:07 -07:00
3961c0efb7
am 746d1e33: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '746d1e3321':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS

Billy Lau   authored and   Android Git Automerger   commited 2015-08-07 22:22:24 +00:00
29ea9fd5c4
Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
Billy Lau   authored and   Android (Google) Code Review   commited 2015-08-07 22:16:03 +00:00
746d1e3321
Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
Merge the CHANGE_NETWORK_STATE permission with WRITE_SETTINGS.

AndroidManifest.xml:
Raised the protection level of CHANGE_NETWORK_STATE permission from
normal to signature|appops and pre23|preinstall for compatibility

provider/Settings:
Wrote new helper methods to check if app is allowed to change network
state.

ConnectivityManager.java & ConnectivityService.java:
Replace enforcement checks for CHANGE_NETWORK_STATE with
checkAndNoteChangeNetworkStateOperations instead.

Change-Id: If8c2dd3c76a5324ca43f1d90fa17973216c2bcc5

Billy Lau   commited 2015-08-07 19:29:51 +01:00
16c5d9a6a7
resolved conflicts for merge of 32380993 to mnc-dr-dev
Change-Id: I3a8624b2b375e0d174983d7690082e0e6932c4de

Paul Jensen   commited 2015-08-05 07:07:24 -04:00
41027a921c
Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-08-05 10:03:47 +00:00
3238099342
Fix NOT_RESTRICTED network capability and enforce it.
With this change:
1. NOT_RESTRICTED should be removed from NetworkRequests that bring up
   special restricted carrier networks (e.g. IMS, FOTA).
2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL
   permission to register
3. Binding sockets to networks without NOT_RESTRICTED requires
   CONNECTIVITY_INTERNAL permission

Bug:21637535
Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321

Paul Jensen   commited 2015-08-04 07:24:24 -04:00
bc99fc7d96
am d7208c5c: Merge "Revise lockdown check in getLegacyVpnInfo()" into mnc-dev
* commit 'd7208c5c4a':
  Revise lockdown check in getLegacyVpnInfo()

Hung-ying Tyan   authored and   Android Git Automerger   commited 2015-07-31 02:57:19 +00:00
ce009dd426
Merge "Revise lockdown check in getLegacyVpnInfo()" into mnc-dev
Hung-ying Tyan   authored and   Android (Google) Code Review   commited 2015-07-31 02:51:32 +00:00
d7208c5c4a
Revise lockdown check in getLegacyVpnInfo()
Return null instead of raising exception in lockdown mode.

BUG=22749146

Change-Id: I0e9e3ded0d189e3fa9e872b7af9fe363799c85d6

Hung-ying Tyan   commited 2015-07-30 10:52:25 +08:00
5b36cd3f37
am 7dffaafc: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
* commit '7dffaafc0d':
  Fix missing onLost NetworkCallbacks when network loses capability

Paul Jensen   authored and   Android Git Automerger   commited 2015-07-30 02:20:49 +00:00
225466b363
Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-30 02:10:50 +00:00
7dffaafc0d
resolved conflicts for merge of 951aabb4 to mnc-dr-dev
Change-Id: I8b33797528f16596f0d350ad38458baa51fcacf6

Paul Jensen   commited 2015-07-29 11:31:53 -04:00
d0b0b466d0
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
Fix missing onLost NetworkCallbacks when network loses capability
If a network no longer satisfies a NetworkRequest, send the onLost
NetworkCallback.  If it was a real request (not listen) then update
the NetworkFactories.

To test this change I created a little infrastructure to fake
different Internet connectivity probe results during tests.  This
allowed me to rewrite some of ConnectivityServiceTest's logic for
validating networks.  This brought to light a couple issues that
I had to address to keep tests passing:
1. testUnlingeringDoesNotValidate was relying on a bad side-effect
   of my old method of ConnectivityServiceTest's logic for
   validating networks, so I rewrote the test.
2. ConnectivityService was not sending out NetworkCallbacks for
   WiFi when Cellular was validated.  I'm including a fix for this
   in this CL also.

Bug:22220234
Change-Id: I29314f38189817f8b2561a213c4f9e8522696663

Paul Jensen   commited 2015-07-28 12:19:32 -04:00
8c23d5f652
am e288b3af: Merge changes I5c994de5,I6cb0dd84 into mnc-dev
* commit 'e288b3af14421731d8f477b97e8d77588f20498b':
  Add a test for public bugs 2111 and 2136.
  Always check off-link connectivity in NetworkDiagnostics.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-07-28 01:20:16 +00:00
b5f86615b6
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
Pass signal strength thresholds inside a Bundle
Bug: 21407651
Change-Id: I2c80e89441e2eb15a246cb1fa9347f886cefa80f

Erik Kline   authored and   Prerepa Viswanadham   commited 2015-07-18 17:28:52 +00:00
2308195d12
Support NetworkCallbacks based on signal strength.
Bug: 21405941
Change-Id: I2ed8a5aeb8dac464a4305671ed22abcacb485bc9

Lorenzo Colitti   authored and   Prerepa Viswanadham   commited 2015-07-18 17:28:26 +00:00
87f93fe6f4
ConnectivityManager API for for packet keepalives.
Bug: 21405946
Change-Id: Ie1f8f8bee684fe2bb1092a9f1bc9f5dc29b1defc

Lorenzo Colitti   authored and   Prerepa Viswanadham   commited 2015-07-18 17:00:13 +00:00
d1039d1731
Make immutable NetworkCapabilities more explicit.
Bug: 21405941
Change-Id: Iafd738c31747b0f5f9356bed1c97f5f282830af1

Lorenzo Colitti   authored and   Prerepa Viswanadham   commited 2015-07-18 16:59:47 +00:00
6d71af1f53
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