Skip to content
Commit 7c770920 authored by Neil Fuller's avatar Neil Fuller
Browse files

Make TimeZoneDetector own its config

Make TimeZoneDetector responsible for configuration of time
zone detection behavior on device and have it enforce user capabilities.

This provides a set of configuration/capability classes, listeners and
tests that should allow SettingsUI apps to switch over to using them
while maintaining existing behavior and restrictions.

Ultimately, this should get us to a point where all time zone detection
configuration is conducted via TimeZoneDetector.updateConfiguration()
rather than modifying / listening to android.provider.Settings directly.

The listener support is intended for any users that currently watch
settings directly.

The TimeZoneCapabilities and TimeZoneConfiguration are designed to be
extensible so that more configuration properties can be added as the
time zone detector becomes more sophisticated. updateConfiguration()
supports partial configs so that clients only need to be explicit about
the config properties they know about and want to change.

This change is also a step towards removing race conditions in time zone
detection that could occur if settings are changed mid-way through a
time zone detection cycle: synchronization in
TimeZoneDetectorStrategyImpl ensures that the configuration won't change
unexpectedly.

Test: atest services/tests/servicestests/src/com/android/server/timezonedetector
Test: atest core/tests/coretests/src/android/app/timezonedetector
Change-Id: I3283b7fb7aa978df44a27ab7cd8cacdbe042b17b
parent 472e277c
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