From 87655fd9707857fd72f68b880155171f9165772c Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Mon, 18 Oct 2021 16:50:56 +0100 Subject: [PATCH] Add a time field to GeolocationTimeZoneSuggestion Add a time field to GeolocationTimeZoneSuggestion for use in upcoming fallback logic. This is should help establish ordering across different time zone detection mechanisms. Bug: 197624972 Test: treehugger Test: frameworks/base: atest services/tests/servicestests/src/com/android/server/timezonedetector/ Test: cts: atest hostsidetests/time/host/ Change-Id: I824679f3eca39a69d5413d365889ad8566d3e557 --- .../GeolocationTimeZoneSuggestion.java | 87 ++++++++++--- .../location/ControllerEnvironmentImpl.java | 7 ++ .../location/ControllerImpl.java | 110 ++++++++++------ .../LocationTimeZoneProviderController.java | 7 ++ .../GeolocationTimeZoneSuggestionTest.java | 46 ++++--- .../TimeZoneDetectorInternalImplTest.java | 4 +- .../TimeZoneDetectorServiceTest.java | 6 +- .../TimeZoneDetectorStrategyImplTest.java | 44 ++++--- .../location/ControllerImplTest.java | 119 ++++++++++++------ 9 files changed, 295 insertions(+), 135 deletions(-) diff --git a/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java b/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java index 1867ee207958b..3b3254985abca 100644 --- a/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java +++ b/services/core/java/com/android/server/timezonedetector/GeolocationTimeZoneSuggestion.java @@ -16,9 +16,11 @@ package com.android.server.timezonedetector; +import android.annotation.ElapsedRealtimeLong; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.ShellCommand; +import android.os.SystemClock; import java.io.PrintWriter; import java.util.ArrayList; @@ -29,27 +31,39 @@ import java.util.Objects; import java.util.StringTokenizer; /** - * A time zone suggestion from a geolocation source. + * A time zone suggestion from the location_time_zone_manager service to the time_zone_detector + * service. * - *

Geolocation-based suggestions have the following properties: + *

Geolocation-based suggestions have the following properties: * *