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
Loading
Please register or sign in to comment