Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ebb81f2 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Add defer-until-active policy to certain broadcasts.

Applying this poicy allows deferring the broadcast delivery to apps
in the Cached state.

Bug: 263809961
Bug: 256597171
Bug: 256597397
Test: atest ./tests/tests/batterysaving/src/android/os/cts/deviceidle/DeviceIdleTest.java

Change-Id: I736da69eb51376c86b5ed41a91ee3e028e242452
parent dc0f1da4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2538,6 +2538,7 @@ public class DeviceIdleController extends SystemService

                final Bundle mostRecentDeliveryOptions = BroadcastOptions.makeBasic()
                        .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
                        .setDeferUntilActive(true)
                        .toBundle();

                mIdleIntent = new Intent(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED);