Skip to content
Commit 44cd068b authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Introduce SettingsProx in place of Settings.

This introduces SecureSettings, GlobalSettings, and SystemSettings
that are instantiable classes that proxy calls through to the static
methods of Settings.Secure, Settings.Global, and Settings.System.

This allows instances to be mocked and faked in tests. This also
removes any concern of changing shared settings between tests.

This also addes registerContentObserver and unregisterContentObserver
to these classes as a convenient way of unifying access to settings.
Previously, settings were read and written via static methods, but
changes to settings were observeed through ContentResolver, an
entirely separate class.

An example refactor using these new utilities is shown in
DozeTriggers.

Fixes: 159904757
Test: atest SystemUITests && manual
Change-Id: I3a907c2066de427676472769e212fe58cd38cf69
parent 0a7fd66f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment