Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
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
Don't display the "no Internet access" prompt on captive portals.
Bug: 20081183
Bug: 21066461
Change-Id: Idc71844a604f9ca655411c6916de256780ea4586

Lorenzo Colitti   commited 2015-05-14 23:46:16 +09:00
9bf1c31e6a
Fix a race when removing from LegacyTypeTracker.
Because LegacyTypeTracker#remove can send broadcasts that cause
apps to refresh their view of network state, it needs to be
called only after network state has been updated. This requires
that callers determine whether the network was the default, and
updating state, before calling remove().

While I'm at it, fix maybeLogBroadcast's concept of whether the
network it's logging about is/was the default. This has never
been correct.

Bug: 20613953
Change-Id: Ia175ac454aa4e0a4c4f0151866314ebada681438

Lorenzo Colitti   commited 2015-05-12 16:48:30 +09:00
2e3a9705cf
Optionally add a default MOBILE request.
This enables persisting the mobile internet data connection, even
when Wi-Fi is enabled and serving as the default network (for faster
network switching).

Change-Id: I9d1512b3a8413c4f163c63d57e66bded017101e4

Erik Kline   commited 2015-05-08 15:22:37 +09:00
74d68efe72
Adding "Connected, no Internet" string in Wifi nw summary.
Bug: 17380953
Change-Id: I9664bcbf33832fe722e7d2b3125939287ee98098

Sanket Padawe   commited 2015-05-01 16:55:00 -07:00
e453b72d39
Remove network access for idle apps
Track apps going in and out of idle in the NetworkPolicyManagerService.
Apply DROP rules in firewall controller if app is to be blacklisted
for network access.

Firewall can now be in whitelist (old) or blacklist mode. When in
blacklist, it allows all by default and we can selectively DENY
some uids.

Track app idle in UsageStats and update periodically.
Track charging/discharging states.

TODO: Check for appidle temporary parole state

Bug: 20066058
Change-Id: Ia65d7544204b3bcb78a517310ef4adcc05aac6fb

Amith Yamasani   commited 2015-04-29 14:21:53 -07:00
68c4363056
Merge commit 'ed4d55c' into merge2
Change-Id: I116a9dbf19e95651a7c50393e4dcd7fb59ca3f3f

Etan Cohen   commited 2015-04-24 13:58:45 -07:00
54c82a8c6b
Allow apps with ACCESS_WIFI_STATE to listen for wifi networks
The compatibility measure introduced in bug 20081183 for apps
that connect to a Wi-Fi network without Internet access and then
expect to be able to use that network requires that such apps
register a NetworkCallback so that their WifiManager can pin them
to whatever wifi Network connects.

Currently, registering the callback requires ACCESS_NETWORK_STATE
and the app may not have that permission. Allow registering wifi
(only) callbacks if the app has ACCESS_WIFI_STATE.

If the app does not have ACCESS_WIFI_STATE (unlikely, since
CHANGE_WIFI_STATE is not very useful without ACCESS_WIFI_STATE),
then don't enable the compatibility measure.

Bug: 20081183
Bug: 20423580
Change-Id: Iad328d30c2d170dead883868fece3d922da68f6f

Lorenzo Colitti   commited 2015-04-22 12:01:35 +09:00
15ff2fc68d
Merge "update API name to requestBandwidthUpdate()"
fenglu   authored and   Android (Google) Code Review   commited 2015-04-22 01:32:19 +00:00
a50d169c9c
update API name to requestBandwidthUpdate()
Change-Id: If26942978ffcc43f06f17dfad5da790f34758395

fenglu   commited 2015-04-21 17:12:05 -07:00
73169332e1