Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
reolve merge conflicts of 4e3d827 to nyc-mr1-dev-plus-aosp
Change-Id: Idb6cca34536fdbb94876d5cde0b2309462840da1

Etan Cohen   commited 2016-09-16 12:40:03 -07:00
c2c7d7ff8a
Support displaying a dialog when wifi becomes unvalidated. am: 199ecfc79f am: 2b5b0e027b
am: 56e32083b5

Change-Id: Id908683dce15ffbafc042d506a38ec26d5e9a6ee

Lorenzo Colitti   authored and   android-build-merger   commited 2016-09-15 16:18:42 +00:00
f23aa46f08
Support displaying a dialog when wifi becomes unvalidated.
am: 199ecfc79f

Change-Id: I8b8e2b652510ca75407a9ad3c29ed111367941e0

Lorenzo Colitti   authored and   android-build-merger   commited 2016-09-15 16:04:03 +00:00
2b5b0e027b
Support displaying a dialog when wifi becomes unvalidated.
Bug: 31075769
Change-Id: I7a6e7580769365bea930f638bd44edcaa28df134

Lorenzo Colitti   commited 2016-09-15 23:33:34 +09:00
199ecfc79f
Add a NET_CAPABILITY_FOREGROUND capability. am: 0f04220ffe
am: aaec66110d

Change-Id: I78d6aa21f8e4c6bbd9cefb4a36f1b77f4bbe4104

Lorenzo Colitti   authored and   android-build-merger   commited 2016-09-13 16:23:10 +00:00
aabaa907de
Add a NET_CAPABILITY_FOREGROUND capability.
Bug: 23113288
Change-Id: I90cb9ffb5751f0d9ec822933f37680c401e49966

Lorenzo Colitti   commited 2016-09-13 12:02:13 +09:00
0f04220ffe
Add a background NetworkRequest type for mobile data always on. am: 2666be8ae7
am: 9396da4e10

Change-Id: I4b0e05e8bb87e37bf2564fd255b8be7a2b20118a

Lorenzo Colitti   authored and   android-build-merger   commited 2016-09-12 13:48:53 +00:00
350a2fef4a
Add a background NetworkRequest type for mobile data always on.
Like a normal (foreground) request, a background request is only
satisfied by one network and will keep that network up. Unlike a
foreground request, when a network only has background requests,
it will linger, and after lingering is complete, it will become
a background network.

Future CLs will cause the system to treat background networks
differently, e.g., by requiring different permissions.

Bug: 23113288
Change-Id: I40f735269dad1042eb04fea15e64584fc903ccb3

Lorenzo Colitti   commited 2016-09-09 18:49:24 +09:00
2666be8ae7
[NAN] Add transport type for NAN. [DO NOT MERGE]
Add TRANSPORT_WIFI_NAN - specifies a peer-to-peer Wi-Fi NAN data
connectivity request.

While NAN uses Wi-Fi L1 PHY and part of the MAC - it is a different
protocol and constitutes a different transport.

(cherry-pick of commit 7473bc20ad)

Bug: 26564277
Change-Id: I975ebc72d8f97a592d18038b3d6465b7a40efa75

Etan Cohen   commited 2016-09-06 15:54:10 -07:00
e7395027cf
Merge \"Add an isListen method to NetworkRequests.\" into nyc-mr1-dev
am: b5239329b1

Change-Id: Ib712c3c7b44d3a623d5f5facf0c7f6844c3ebb82

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-18 15:08:54 +00:00
d160a5b13a
Add an isListen method to NetworkRequests.
This allows simplification of the ConnectivityService code.

Bug: 23113288
Change-Id: I124544b99c5a920124e9a3d31cda8c6d2abc21fd

Lorenzo Colitti   commited 2016-07-18 18:42:26 +09:00
3ed97e63bb
Add IPv6 tethering coordinator
am: 6f0405308b

Change-Id: Icf8034276d4edc7167ad03ff8860ac8e3d05c464

Erik Kline   authored and   android-build-merger   commited 2016-07-13 04:57:17 +00:00
4875f44794
Add IPv6 tethering coordinator
Add an IPv6TetheringCoordinator to TetheringMaster StateMachine, which
receives and processes NetworkState updates and passes the necessary IPv6
information to the revelant TetherInterfaceStateMachine.

Add an IPv6TetheringInterfaceServices to TetherInterfaceStateMachine, which
is responsible for adding local network routes and managing an IPv6
RouterAdvertisementDaemon.

Bug: 9580643
Change-Id: I3eaae460b80752e2115359d7bde873a1e9ea515a

Erik Kline   commited 2016-07-13 12:08:06 +09:00
6f0405308b
Support requesting async LinkProperties/NetworkCapabilities updates
am: 0c04b74781

Change-Id: Icc048323debbbe641941c5c0d993f4c9782c5d3e

Erik Kline   authored and   android-build-merger   commited 2016-07-11 11:01:42 +00:00
b2bdeca8e2
Basic IPv6 Router Advertisement daemon
am: 1a1cb0e914

Change-Id: I242eb8e932581a537a47f31e3f16c7e776da91cf

Erik Kline   authored and   android-build-merger   commited 2016-07-11 10:38:49 +00:00
78bf01826a
Support requesting async LinkProperties/NetworkCapabilities updates
Bug: 9580643
Change-Id: I1d7ba7645c20d7d53f6eef777dfce43727940f13

Erik Kline   commited 2016-07-11 19:17:41 +09:00
0c04b74781
Basic IPv6 Router Advertisement daemon
Bug: 9580643
Change-Id: Iebd4d1f694699ffd4daf7d71e9b9d8f49e9b632f

Erik Kline   commited 2016-07-11 18:37:25 +09:00
1a1cb0e914
Merge \"ConnectivityManager: no double callback remove\" into nyc-mr1-dev
am: 0ecfb2fd34

Change-Id: Ib7b10c59c1f7c84ec78c7527fba8a6c9aa5b0c05

Hugo Benichi   authored and   android-build-merger   commited 2016-07-07 09:38:29 +00:00
bafb27388b
ConnectivityManager: no double callback remove
This patch partially undoes ag/869831 (Change-Id:
Ia42ed7aefaebd8caf3eada8e42b6cb7a940d7647) so that ConnectivityManager
does not remove callbacks from its internal request-to-callback map at
unregistration, but instead let the singleton CallbackHandler do it when
receiving a CALLBACK_RELEASED from ConnectivityService.

ag/869831 was thought to fix b/26749700 that reported a callback leak
from sNetworkCallback, but a finer analysis of the code shows that
callbacks were correctly removed by the CallbackHandler before
ag/869831. There was therefore no callback leak.

Bug: 26749700
Bug: 28537383
Change-Id: I421d889d0e225c0e3d1eebea664f44a1cc0f3191

Hugo Benichi   commited 2016-07-07 09:44:02 +09:00
f778e2546f
Merge \"Unbreak unregisterNetworkCallback.\" into nyc-mr1-dev
am: 0271c0d4ef

Change-Id: I35ee16554e17c503b1f5628629c2c0a48d85d399

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-05 02:19:18 +00:00
5a7cd3500d
Unbreak unregisterNetworkCallback.
http://ag/1194313 broke unregisterNetworkCallback because the
system does not parcel the type of the request back to the app.
So when the app calls unregisterNetworkCallback, the
NetworkRequest that's passed in does not have a type and thus
doesn't match the request in mNetworkRequests.

Fix this by parceling over the type as well.

This was not caught by the unit test because the unit test all
runs in the same process with no parceling.

Bug: 23113288
Change-Id: I58b2ed651b9bf5cbdcca5b25c3ca24db53cffdf1

Lorenzo Colitti   commited 2016-07-05 01:59:49 +09:00
70964d3a18
Merge changes from topic \'networkrequest_private\' into nyc-mr1-dev
am: 0317e03dc3

Change-Id: Ia063c378bd32fdb056c0ecdc0f721d32e9fa49af

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-01 15:20:21 +00:00
9d1139ee06
Move the request type from NetworkRequestInfo to NetworkRequest.
This will allow us to simplify code that deals with
NetworkRequests outside ConnectivityService.

Bug: 23113288
Change-Id: I9b3a859d0c68cad73d7f6baa4b584d13ffd2ae36

Lorenzo Colitti   commited 2016-07-01 20:15:19 +09:00
eafe85717c
Merge \\\"Changes for upgrade to OkHttp 2.7.5\\\" am: 5c3bebd673 am: 1f44659b2f
am: 6b473f7b67

Change-Id: I3a0dc1da2ee96d71c38cab727141efcb686627e1

Tobias Thierer   authored and   android-build-merger   commited 2016-06-30 13:04:52 +00:00
4b2e1aef96
Merge \"Changes for upgrade to OkHttp 2.7.5\"
am: 5c3bebd673

Change-Id: Id79249756929a61dca374f9f1d43d0ea9e6b1280

Tobias Thierer   authored and   android-build-merger   commited 2016-06-30 12:49:47 +00:00
1f44659b2f
Changes for upgrade to OkHttp 2.7.5
- Use com.android.okhttp.Dns in place of com.android.okhttp.internal.Network
 - Specify TimeUnit.MILLISECONDS for timeouts which 2.7.5 allows and
   brings us closer to 3+

Change-Id: I95b5d72a94ebe1389f7c2e8d95903aa1aadd944b

Tobias Thierer   commited 2016-06-29 17:41:32 +01:00
858e39459e
cold sim clean up
- add a new field: provisioningNotificationEnabled from NetworkMisc. set
  to false if we want to hide "sign in" notification and placed
  carrier-specific notification instead. it is set on connect, once set,
  it is carrier-app's responsibility to post new UI to users
- rework on the interaction between carrier app and framework
- code cleanup
- unit test support

Bug: 28567303
Change-Id: Ic84db7ffbb920d15344717f104496d3cb82e1a85

fionaxu   commited 2016-06-03 11:45:12 -07:00
5310c30967
API council feedback: hide and document.
Hide isMetered() and clarify moveDatabaseFrom() docs.

Bug: 28870582, 28775585
Change-Id: Iabe63045c39ce7f662488f4224b56387c3c59519

Jeff Sharkey   commited 2016-05-20 11:34:55 -06:00
ca4340007e
DHCPv4: lease expiration is fatal, renew failures are not
Bug: 24837343

Change-Id: Ib330864f8376b0907390d581b48cff5446b3392b

Erik Kline   commited 2016-05-18 16:17:03 +09:00
7b0a58168e
Merge "Make some of the UID-based VPN code reusable" into nyc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2016-05-17 17:30:01 +00:00
89bf3e3aa2
Documented return value of getRestrictBackgroundStatus().
Change-Id: I2c15a6d5e23cbc3c9b59c975196c1c04c1294471
Fixes: 28775490

Felipe Leme   commited 2016-05-16 13:57:19 -07:00
3edc616bf6
Make some of the UID-based VPN code reusable
By changing some member refs into arguments and having one of the
functions create the UID range instead of adding to mVpnUsers.

This will be useful for other layers of UID filtering like having
UIDs explicitly blocked from the VPN.

Deleted one broken line of code that cleared the status intent when
a restricted profile is removed. Other than that, this commit shouldn't
change any behaviour. If it does, that's a bug.

Bug: 26694104
Change-Id: Ieb656835d3282a8ba63cc3f12a80bfae166bcf44

Robin Lee   commited 2016-05-13 16:03:11 +00:00
722ee0bb43
Merge "Add lockdownEnabled parameter to always-on VPN API" into nyc-dev
Robin Lee   authored and   Android (Google) Code Review   commited 2016-05-04 18:38:30 +00:00
fb0faa494e
Add lockdownEnabled parameter to always-on VPN API
Allows callers to opt-out of blockading network traffic during boot and
on VPN app failure.

Bug: 26694104
Change-Id: Ibfbd43ad09a25f2e38053fcd6306df3711f8bde2

Robin Lee   commited 2016-05-03 13:24:42 +01:00
94e69beca3
Flag to mark foreground jobs, fix data saver.
When a job will eventually run in the foreground, the internal
scheduling needs to ignore any background network restrictions when
satisfying constraints.  This also means the job should ignore the
current device doze state, since the requesting app could get the
same behavior by starting their own foreground service.

Always dispatch network policy changes to ConnectivityService first
to ensure that it has up-to-date information.  Fix bugs around data
saver that were causing networks to not be marked as BLOCKED for
background apps; before this fix apps would have been spinning in
internal connectivity loops, thinking that the network was actually
connected when the kernel was actually blocking their traffic.

Offer new ConnectivityService method overloads to ignore the blocked
state for a specific UID.

Print unsatisfied job constraints to aid debugging.

Bug: 26571724
Change-Id: Iaaa17933e6dc1bf6d3dff26d0bfc12222e51e241

Jeff Sharkey   commited 2016-04-29 13:44:07 -06:00
7dbf83df03
Merge changes I8de95add,Ia6f4ccfd into nyc-dev
* changes:
  Remove unused event tags of IpConnectivityEvent
  Better ConnectivityMetricsEvent printing

TreeHugger Robot   authored and   Android (Google) Code Review   commited 2016-04-27 01:49:53 +00:00
6333d09474
Better ConnectivityMetricsEvent printing
This patch adds more information printing for IpConnectivity event
classes in android.net.metrics.

example:

ConnectivityMetricsEvent(14:36:35.799, 0, 1026): DhcpClientEvent(wlan0, DhcpRequestingState)
ConnectivityMetricsEvent(14:36:35.805, 0, 1026): DhcpClientEvent(wlan0, DhcpHaveAddressState)
ConnectivityMetricsEvent(14:36:35.809, 0, 4096): IpManagerEvent(wlan0, PROVISIONING_OK, 155ms)
ConnectivityMetricsEvent(14:36:35.810, 0, 1026): DhcpClientEvent(wlan0, DhcpBoundState)
ConnectivityMetricsEvent(14:36:35.871, 0, 2048): NetworkEvent(101, NETWORK_CONNECTED, 0ms)
ConnectivityMetricsEvent(14:36:35.874, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:599, 3ms)
ConnectivityMetricsEvent(14:36:35.874, 0, 2048): NetworkEvent(101, NETWORK_VALIDATION_FAILED, 0ms)
ConnectivityMetricsEvent(14:36:35.928, 0, 3072): DefaultNetworkEvent(0 -> 101, [WIFI], IPv4: false, IPv6: false)
ConnectivityMetricsEvent(14:36:37.008, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:204, 134ms)
ConnectivityMetricsEvent(14:36:37.008, 0, 2050): NetworkEvent(101, NETWORK_VALIDATED, 1137ms)

Also fixes a couple of event logging issues:
  - do no record spurious receive DhcpErrorEvent when a network goes down.
  - add an eventType field to IpManagerEvent instead of using the
    loggger component tag.

Bug: 28204408
Change-Id: Ia6f4ccfd7a0c63a5ccec18825f226c0b5781217b

Hugo Benichi   commited 2016-04-27 09:11:29 +09:00
e51bf9e2a4
Merge "Frameworks/base: Make debug helper lazy in ConnectivityManager" into nyc-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2016-04-26 15:25:44 +00:00
2082480038
Frameworks/base: Make debug helper lazy in ConnectivityManager
Place helper map for callback field names into a holder. This avoids
the reflective calls in static initialization of ConnectivityManager
in the common (non-debug) case, which means the class can be
compile-time initialized. Also saves the storage necessary (both
the storage array as well as the reflection metadata).

Follow-up to b027e6e92b.

Bug: 27265238
Change-Id: Ib4bfaf27acd234a035a5d198458340099a156a4c

Andreas Gampe   commited 2016-04-25 10:30:53 -07:00
b704658951
API changes for DownloadManager and JobScheduler.
To support moving DownloadManager, add new JobScheduler network type
constraint that matches "any network except roaming."  Also add an
API to get a specific JobInfo by ID.

Since the default network can be different on a per-app basis, and
individual apps may be blocked due to app standby, evaluate job
connectivity constraints on a per-UID basis.  To implement this
cleanly, add NetworkInfo.isMetered() to match the isRoaming() API.

Add new DownloadManager APIs to support charging and device idle
constraints, which are plumbed through to JobScheduler under the
hood when scheduled.

Add filtering to JobScheduler dumpsys to omit noisy details for
packages the caller isn't interested in.

Bug: 28098882, 26571724, 19821935
Change-Id: I09ca7184ef7ce6adba399f579d415a5fb2ea6110

Jeff Sharkey   commited 2016-04-24 14:39:34 -06:00
40d1fb87a4
Disambiguate NetworkCallback JavaDoc.
The JavaDoc for many of the requestNetwork and
[un]registerNetworkCallback APIs incorrectly mentions the
PendingIntent version of the APIs instead of the NetworkCallback
version.

Also fix a minor issue in the registerDefaultNetworkCallback
JavaDoc: the default network request is an implementation detail,
so don't mention it. Instead, talk about the "system default
network".

Change-Id: Id94d98261daa2bd768c10e033cb8092729b21c91

Lorenzo Colitti   commited 2016-04-15 16:24:13 +09:00
15874cd028
Merge "Fix a memory leak in ConnectivityManager." into nyc-dev
Pierre Imai   authored and   Android (Google) Code Review   commited 2016-04-13 06:37:33 +00:00
a5ccd54500
If Internet probe is redirected, pass redirect destination to NetworkAgent.
Transport may use the redirect to make additional determination about network
state.

Bug: 25203607
Change-Id: I07d8918f13fdcbe0b6fd757536bfc1850a2a244f

Paul Jensen   commited 2016-04-12 08:54:36 -04:00
9c9e48fbd1
Fix a memory leak in ConnectivityManager.
Remove callbacks from the internal storage when they are being unregistered.

Change-Id: Ia42ed7aefaebd8caf3eada8e42b6cb7a940d7647

Pierre Imai   commited 2016-04-12 15:00:28 +09:00
66d9bd8806
Merge "Internal API for system apps to determine default network for other apps" into nyc-dev
Robin Lee   authored and   Android (Google) Code Review   commited 2016-04-07 16:43:15 +00:00
80f2000491
Internal API for system apps to determine default network for other apps
Callers with CONNECTIVITY_INTERNAL permission can read off the netId
that an application is assigned to by default.

Necessary for making connections as the default network for a client
app eg. when downloading stuff on its behalf.

Bug: 27074270
Change-Id: I8d35e8e99126875f55f3c545090326f3e9be43fb

Robin Lee   commited 2016-04-07 14:55:59 +00:00
5b52bef8d8
Make public the registerDefaultNetworkCallback API
Change-Id: I89d7a6f49f5d6a0da3402a07407b0f8d93181b4f

Erik Kline   commited 2016-04-06 12:22:47 +09:00
7c912a4025
Move ApfFilter from ConnectivityService to IpManager
There's a few advantages to having ApfFilter in IpManager:
1. If things go wrong, crashing a particular transport is less bad then
   crashing ConnectivityService.  We also don't want to use
   ConnectivityService as a dumping ground for transport-specific logic.
2. This makes implementing WifiManager.MulticastLock a lot simpler and
   safer because enabling/disabling it doesn't have to go through the
   NetworkAgent, which could risk various races (e.g. installing a filter
   into the wrong WiFi network).
3. IpManager is the ultimate source for LinkProperties for a particular
   transport and since ApfFilter uses the LinkProperties it's better to
   have it closely paired with the IpManager. Likewise, ApfFilter needs
   to know the APF capabilities of the transport, so having it in
   the transport avoids having to parcel this information through the
   NetworkAgent.

Bug: 26238573
Change-Id: I99b85f2b64972f0e7572170ec5d1926081aa3429

Paul Jensen   commited 2016-03-25 07:46:07 -04:00
6b7f7a0852
Merge "Improve NetworkCapabilities command chaining." into nyc-dev
Pierre Imai   authored and   Android (Google) Code Review   commited 2016-03-23 01:11:15 +00:00
9b71d6659d
Merge changes Iddeebeb8,Idd1e37a3 into nyc-dev
* changes:
  WifiManager: Use ConnectivityThread
  Create ConnectivityThread

Paul Stewart   authored and   Android (Google) Code Review   commited 2016-03-22 22:23:48 +00:00
e611bda1e2