Don't allow background apps to change theme

A background app that changes the wallpaper, was able to change the
device theme.

This change will apply the theme if the app is on the foreground, like
WallpaperPicker would be, but would defer the event until the next power
button cycles, like we do with Live Wallpapers, to avoid the same type
of DoS.

Test: manual
Test: atest ThemeOverlayControllerTest
Fixes: 205140487
Change-Id: I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
Merged-In: I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
(cherry picked from commit efaa814a99bc86992c0823f07b015b9a6f80ad75)
Merged-In:I2086b29ef9bf3bb6fb7d9ebba6e7b8db9392e459
4 files changed