am: 9a977b7d45
* commit '9a977b7d45df0d3d59c5eec7f9534c3bd5fcd91d':
Flag to mark foreground jobs, fix data saver.
Change-Id: I908d725a84e9590d0da38a586b066a63473d4f28
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
am: 9dee0bccd8
* commit '9dee0bccd8e692d1ca86bcf7180170f153dc99c7':
Stop user faster and clear stale broadcasts
Change-Id: I16c4c1dfcff9f4d63da0444923a29fda0bea5ee8
am: 2bb6008a4c
* commit '2bb6008a4cd20654b268e13276c6a56ecc0eab2b':
Stop user faster and clear stale broadcasts
Change-Id: I423d1f8448f8ba5b54f90a2fa192f231f38b761c
am: ec6faca007
* commit 'ec6faca0078263dfbf2b41d11cdb14586e40fd75':
Stop user faster and clear stale broadcasts
Change-Id: I36eeb177791730a26077542606559e3e4428b87e
Moved several USER_STOPPING registered receivers to listen
to USER_STOPPED, since they don't need to be blocking the
shutdown of the user.
Clear all stale broadcasts when stopping a user, so that we
don't unnecessarily start up processes and deliver stale
broadcasts. This was causing code to run when the user was
already stopped and resulted in crashes when other providers
and services couldn't be started anymore. Hopefully this fixes
many of those races.
Bug: 28371487
Change-Id: Ic35a7a23fa8fe009a53f8bf7545d4dad5fa34134
am: 7f026f8
* commit '7f026f8927c30180817f46ee38ee292ad05997ff':
Tethering and Data Saver: There Can Be Only One!
Change-Id: Idb0ab16443ca061f97ed2f12e0ee01d9fa61b187
am: 5af619f
* commit '5af619f1cdd78fa1cd799ea05f1b59b75b589a0d':
Tethering and Data Saver: There Can Be Only One!
Change-Id: I876c9a30e9451b1c346296c233068bdfb579f584
If tethering is on when Data Saver mode is turned on, tethering should
be disabled, and vice-versa.
BUG: 28313291
Change-Id: I7f3dadbd97ea1492ab76b41043dea7487c1db02d
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: 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