From 59ff2dca0ee529c00ef0c0892430d9f33296c83c Mon Sep 17 00:00:00 2001 From: Neil Fuller Date: Tue, 6 Apr 2021 19:40:55 +0100 Subject: Adjust geotz feature config logic A set of related changes under the heading of "configuration logic changes". The ability to 'discover' the package of a LTZP has been removed. A provider's package name must now match the package name held in config.xml. This takes advantage of changes in ServiceWatcher (which, due to a recent change, no longer insists on specific configuration options). It will allow the package name to be determined at runtime via server flags in a future change, which will make future testing easier. The overall location time zone detection feature can also now be configured on and will not "show up" if there are no providers currently enabled. The ability to have the location time zone detection feature "supported" on the device be on and not have it "show up" in the UI when there are no providers will make testing easier when the secondary provider has been removed from AOSP (bug 178169250). To remove command line duplication of things that can now be achieved via device_config (AKA server flags), there have been various command line changes. It is also now possible to override a provider's "mode" via the command line to be "enabled". Previously, a provider could only be disabled or set into a simulation mode via the command line, which assumed the default state was "enabled" (bug 178169250). Bug: 175718363 Bug: 178169250 Test: See the associated change in cts/ Change-Id: I0d3314155cef4f122cae0d569b4687b658e777b1 --- .../android/app/time/LocationTimeZoneManager.java | 25 --- core/res/res/values/config.xml | 26 +-- core/res/res/values/symbols.xml | 2 - .../android/server/timedetector/ServerFlags.java | 29 ++- .../timezonedetector/ServiceConfigAccessor.java | 107 ++++++--- .../timezonedetector/location/ControllerImpl.java | 18 +- .../location/LocationTimeZoneManagerService.java | 243 +++++++++------------ .../LocationTimeZoneManagerShellCommand.java | 107 +++++---- .../RealLocationTimeZoneProviderProxy.java | 8 +- 9 files changed, 295 insertions(+), 270 deletions(-) diff --git a/core/java/android/app/time/LocationTimeZoneManager.java b/core/java/android/app/time/LocationTimeZoneManager.java index 066aadae1476..f506f12a7ba0 100644 --- a/core/java/android/app/time/LocationTimeZoneManager.java +++ b/core/java/android/app/time/LocationTimeZoneManager.java @@ -49,31 +49,6 @@ public final class LocationTimeZoneManager { */ public static final String SHELL_COMMAND_STOP = "stop"; - /** - * A shell command that can put providers into different modes. Takes effect next time the - * service is started. - */ - public static final String SHELL_COMMAND_SET_PROVIDER_MODE_OVERRIDE = - "set_provider_mode_override"; - - /** - * The default provider mode. - * For use with {@link #SHELL_COMMAND_SET_PROVIDER_MODE_OVERRIDE}. - */ - public static final String PROVIDER_MODE_OVERRIDE_NONE = "none"; - - /** - * The "simulated" provider mode. - * For use with {@link #SHELL_COMMAND_SET_PROVIDER_MODE_OVERRIDE}. - */ - public static final String PROVIDER_MODE_OVERRIDE_SIMULATED = "simulated"; - - /** - * The "disabled" provider mode (equivalent to there being no provider configured). - * For use with {@link #SHELL_COMMAND_SET_PROVIDER_MODE_OVERRIDE}. - */ - public static final String PROVIDER_MODE_OVERRIDE_DISABLED = "disabled"; - /** * A shell command that tells the service to record state information during tests. The next * argument value is "true" or "false". diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 180fc124f92e..cbd6b797c3b6 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1637,32 +1637,22 @@ config_timeZoneRulesUpdateTrackingEnabled are true.] --> 5 - + true - false - - false - + @null - true - - false