Skip to content
Commit e6601764 authored by Kweku Adams's avatar Kweku Adams
Browse files

Add charging parole notification for network changes.

This is a partial revert of the change to remove parole from
AppStandbyController (Ide382ad7fb9c7441f0a5232833ad39bf8c3a1e94). This
adds back the listener and notification of when parole (due to charging)
turns on and off so that NetworkPolicyManagerService can quickly update
the network policy for affected apps. AlarmManager and JobScheduler
already listen to charging status, so I'm excluding them from this
change to make it as simple and low-risk as possible.

This has a slight change to follow standard practice where a client
registering a listener retrieves the current value after registering
the listener instead of the registerListener() method calling the
listener's onStateChanged() method.

Bug: 151802309
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Test: atest --rerun-until-failure 10 com.android.cts.net.HostsideRestrictBackgroundNetworkTests
Change-Id: I18d8d771d455456351e3a9a6c9469e4ec620ae4e
parent bf8d4b44
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment