Apply "night mode" device effect immediately if the keyguard is showing

We were delaying non-user-triggered night mode changes, except those that happened with the screen off. This is too conservative and it's also fine to do so if the keyguard is showing. This is especially useful to allow the mode switch in the "bedtime mode ends on morning alarm" case, when the alarm ringing turns on the screen (and displays its activity on top of the lockscreen).

Fixes: 365088439
Test: atest DefaultDeviceEffectsApplierTest NotificationManagerZenTest
Flag: android.app.modes_ui
Change-Id: Icf732594dcd00adad55128a345d056ec4489e88a
2 files changed