Apply "most-recent" delivery policy to certain broadcasts.

Applying the policy to DEVICE_IDLE_MODE_CHANGED and
LIGHT_DEVICE_IDLE_MODE_CHANGED broadcasts so that when dispatching
these broadcasts, we can discard any older broadcasts waiting
to be delivered and deliver only the most recent to the receivers.

Bug: 256597171
Bug: 256597397
Test: atest ./tests/tests/batterysaving/src/android/os/cts/deviceidle/DeviceIdleTest.java
Change-Id: Icfade7cd207d525d29856bb050ca4377085dbbc1
1 file changed