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

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

Add status to TimeZoneCapabilitiesAndConfig

Update LocationTimeZoneProviderController to report newly available
status information.

After this change, the location_time_zone_manager now informs the
time_zone_detector of status changes, not just suggestion changes. To
reflect this, the path from location_time_zone_manager to
time_zone_detector involves a new "LocationAlgorithmEvent" (which can
contain an optional suggestion) and not the suggestion directly.

In fact, location_time_zone_manager may over-notify (i.e. when neither
status nor suggestion have changed) to reflect internal state changes in
LocationTimeZoneProviderController, but the time_zone_detector can
easily recognize dupes and discard them while keeping the latest event
received for logging / debugging.

The reason for this change is so that time zone detector status
information can be added to TimeZoneCapabilitiesAndConfig for use by
SettingsUI in upcoming UI changes. The full structure is represented
(Overall detector -> Detection Algorithms -> Sub-components like time
zone providers) so that the UI folks can use what they want today.

The initial use is so that SettingsUI can show user alerts / warnings
about "bad" location settings that are blocking / degrading location
time zone provider behavior. This change is also included in this commit
so the whole end-to-end path is implemented.

When the detector status changes, the UI (TimeZoneListener) listeners
will now be informed.

Manual testing:

Various commands tried like:

adb shell cmd time_zone_detector handle_location_algorithm_event \
  --status '"LocationTimeZoneAlgorithmStatus{mAlgorithmStatus=RUNNING, mPrimaryProviderStatus=NOT_READY, mPrimaryProviderReportedStatus=null, mSecondaryProviderStatus=NOT_READY, mSecondaryProviderReportedStatus=null}"'

Bug: 236624675
Test: See manual test instructions
Test: atest services/tests/servicestests/src/com/android/server/timedetector/
Test: atest services/tests/servicestests/src/com/android/server/timezonedetector/
Test: atest ./tests/tests/time/src/android/app/time/cts/
Test: atest core/tests/coretests/src/android/service/timezone/
Test: atest core/tests/coretests/src/android/service/time/
Change-Id: I50636bf75ad2f57ddeb1dce829678cf354b2a05a
parent e13dc3f4
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