Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
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
Merge "Revive ConnectivityServiceTest and add some tests." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-04 13:11:34 +00:00
4371d961b1
Revive ConnectivityServiceTest and add some tests.
Change-Id: I44740a7b21cff18ac2a67d09c4d0e597add19ee0

Paul Jensen   commited 2015-06-04 09:09:36 -04:00
a871d06625
Merge "Disable mDefaultDns to see if we can remove it." into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-06-04 05:31:59 +00:00
33464fb66c
Delete unsed mDnsLock.
Bug: 21449922
Change-Id: I0c9f95c30eaa170d809e86f6505379f34a0a7603

Erik Kline   commited 2015-06-03 16:10:08 +09:00
783cc254e3
Make the dumpsys connectivity shorter and easier to read.
- Print NetworkFactories on one line.
- Only print LegacyTypeTracker networks if they are connected,
  and record supported network types on a separate summary line.
- Print all tethering upstreams on one line.
- Summarize the state of the transition wakelock on one line.
- Don't print Inet condition reports if there are none.
  (Currently there can never be any.)

Bug: 21449922
Change-Id: Ib4b29a7fd882e6c105839a255fffecf4f346cf7e

Lorenzo Colitti   commited 2015-06-03 11:29:41 +09:00
417c25c8cb
Network Reset should have a lockdown like Factory Reset.
bug:20332322
Change-Id: I7c61a011d11e89513757f112abf320bb2a785edb
(cherry picked from commit 94b038bbb291431a7b39611d72f206b07e839891)

Stuart Scott   commited 2015-06-01 16:31:00 +00:00
493cca03f8
Null-check argument to ConnectivityManager.releaseNetworkRequest(PendingIntent)
Do this in ConnectivityService to prevent crashing framework.

Bug:21329396
Change-Id: Ifd9c970cd0da392d0bd5da9a9ae845fdf0b559b3

Paul Jensen   commited 2015-05-21 08:15:08 -04:00
cdc9384d58
Merge "Query HTTP proxy for network via a new API to avoid permissions exceptions" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-05-19 17:58:11 +00:00
71c05810c2
Disable mDefaultDns to see if we can remove it.
Bug: 21146610
Change-Id: I385f1c8780acc97d955002f469a6c8ad65db1578

Lorenzo Colitti   commited 2015-05-20 00:35:25 +09:00
2c57c17908
Merge "Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen." into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-05-19 10:29:48 +00:00
afe4a812a9
Merge "Support cross-user VPN calls (with permission)" into mnc-dev
Robin Lee   authored and   Android (Google) Code Review   commited 2015-05-19 10:14:59 +00:00
c5bd6cc964
Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen.
1. Always keep ConnectivityService's validated bits current:
   - Apply the validated bit whenever a NetworkAgent updates its
     NetworkCapabilities.
   - Set or clear the validated bit whenever lastValidated changes.
2. Send callbacks when the validation state of a network changes.
3. Delete getNetworkCapabilitiesAndValidation, removing code
   duplication with getNetworkCapabilities.
4. Add the validated bit to NetworkCapabilities#toString.

Bug: 18591282
Bug: 20081183
Change-Id: I6aa53b61c15cc137f203f9fc6bbd4c16894be750

Lorenzo Colitti   commited 2015-05-19 18:29:02 +09:00
9809729e2f
Support cross-user VPN calls (with permission)
Settings and SystemUI need to act on other users than USER_OWNER.

This is gated by INTERACT_ACROSS_USERS_FULL in addition to the existing
CONTROL_VPN checks, so the number of processes able to interfere with
other profiles' VPNs should be quite small.

Bug: 20692490
Bug: 20747154
Bug: 20872408
Change-Id: I6e5d7220f73435bec350719e7b4715935caf4e19

Robin Lee   commited 2015-05-18 23:35:31 +01:00
5ff73b7b91
Query HTTP proxy for network via a new API to avoid permissions exceptions
Add @hidden ConnectivityManager.getProxyForNetwork() API.

Bug:20470604
Change-Id: I6a9bc4afc8273bc43b14cdeccfedbbf3ff66be40

Paul Jensen   commited 2015-05-18 17:05:51 +00:00
fdec88b48d
Statically import NetworkCapabilities constants for brevity.
Bug: 18591282
Change-Id: I41c148951724136f31bc663fd81ca9f5de72818a

Lorenzo Colitti   commited 2015-05-14 23:46:17 +09:00
d21a526ac9