Add defer-until-active policy to ACTION_SCREEN_ON/OFF.

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

Bug: 255532556
Test: atest --test-mapping services/core/java/com/android/server/power
Change-Id: I3b5acfb0d6a0c3d8a12776444c51aae70073bdf7
This commit is contained in:
Sudheer Shanka
2023-01-24 16:34:02 -08:00
parent dc0f1da44f
commit c2ac4a6828

View File

@@ -240,6 +240,8 @@ public class Notifier {
options.setDeliveryGroupMatchingKey(
UUID.randomUUID().toString(),
Intent.ACTION_SCREEN_ON);
// This allows the broadcast delivery to be delayed to apps in the Cached state.
options.setDeferUntilActive(true);
return options.toBundle();
}