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
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
This patches changes how captive portal tests and network lifecycle
events are logged as connectivity events:
- it splits NetworkMonitorEvent into two event classes:
- ValidationProbeEvent for logging individual probe events.
- NetworkEvent for logging network connection, validation,
lingering, and disconnection.
- it removes the redundant CaptivePortalCheckResultEvent class.
The information logged in CaptivePortalCheckResultEvent was already
logged by NetworkMonitorEvent, but missing the evaluation durations.
It is now logged by ValidationProbeEvent.
- it removes the CaptivePortalStateChangeEvent class, which is now
redundant with NetworkEvent, but missing evaluation durations.
In addition, it adds event logging when ConnectivityService puts a
network into lingering or removes a network from lingering.
Bug: 28204408
Change-Id: I8f9752e4d36175ecfcbd1545a01a41bad6e06ea4
am: 1b52fcfc1d
* commit '1b52fcfc1db74d63fcb3a873700cf1beea3dfb93':
Cap number of NetworkRequests a UID can make to 100
Change-Id: I72fe474d3618c2900e972cefdc85e80767610405
am: 6a8a98c57a
* commit '6a8a98c57a28e42ad2bb4cd3e2f91b484343071f':
Cap number of NetworkRequests a UID can make to 100
Change-Id: I44df1d666f710f938951820227090c4dbbbb7293
am: eaa8684da7
* commit 'eaa8684da7ef1148e347118f1a4b146caea108a1':
Cap number of NetworkRequests a UID can make to 100
Change-Id: Ic664fa080316eff75dd22fc8e84431cb0eb903be
When users add or remove an app to the Data Saver Mode whitelist, the
app is notified through a
ConnectivityManager.ACTION_RESTRICT_BACKGROUND_CHANGED. But besides this
broadcast, it's also necessary to notify internal apps such Settings,
hence a new method is being added to INetworkPolicyListener.
BUG: 27481520
Change-Id: I1537a77becf6b7da1535ed5faabdc894fd9f7084
am: 0928b62
* commit '0928b620d2f0b78d49b13059eba475da4801ad70':
When the applicantion is removed, reset network permission of this uid.
Change-Id: I3750e3f805bfc71558025fe078f1ad25e5af7cff
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
am: 886d17c
* commit '886d17c035805cef3bce3d2d96e53ba48bf5b62b':
Also log IPv4 and IPv6 connectivity of any previous default network
Change-Id: I8c82f1058531d1f5a0cdb73314b8fd742dae7860
am: f8ef3c3
* commit 'f8ef3c36a97b68b5e27127681973244f481cca09':
Log an event whenever we lose the default network.
Record the transport types for connectivity events.
Change-Id: If019f2c448ed3411a0b23dfdd6038e1b9fe2099d