Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

Rewire config for time zone detection services

All configuration-related logic (static, server flags, user settings)
for time zone detector services has been consolidated in the
ServiceConfigAccessor.

Previously, some configuration, the parts that were most associated with
time_zone_detector and mostly user-facing was located in the
TimeZoneDetectorStrategyImpl, which meant that there was quite a lot of
plumbing logic to get the user config info / events to the
location-based detection code which was added in S.

The ServiceConfigAccessor was already a singleton that several of the
classes involved were referencing. The baroque listener chaining has
been simplified: everything just talks to the ServiceConfigAccessor
rather than being wired (sometimes indirectly) to the
TimeZoneDetectorStrategy. The interface for ServiceConfigAccessor has
been extracted to enable easier unit testing, the implementation is now
ServiceConfigAccessorImpl.

This refactor simplifies the TimeZoneDetectorStrategyImpl, which no
longer deals with user configuration, and is just another client of the
ServiceConfigAccessor.

ServiceConfigAccessor is now a larger lump of hard-to-unit-test logic,
but coverage of the detection algorithm logic itself hasn't dropped
significantly, as can be seen from the test changes.

Bug: 197624972
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Test: atest cts/hostsidetests/time/host/src/android/time/cts/host/
Change-Id: Ib70e6a37a1ebfc894840a3e02224522e8cefdac3
parent 76df467c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment