OverlayManagerService: Make broadcasts/updates explicit

Previously there was a listener attached to the Settings object
which would fire any time a single settings change was made.
This made it very inefficient to do batch updates.

This change makes the Settings object return its mutated status
on each call to a mutating method, allowing the caller to keep track
of whether or not to notify the listener of any changes.

This allows for the implementation of setEnabledExclusive, where
all but the target overlay are disabled and only a single notification
/ update is sent out.

Bug: 36099320
Test: manual (with OverlayManagerService.DEBUG = true), observe logcat
Test: when Going to Settings -> Display -> Advanced -> Themes and
Test: selecting a theme.
Change-Id: Ic8b8ca3ba0cf5d2d682bf6dac5a6c82e4f0f2502
4 files changed