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

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

Implement flag for auto tz detection default

For internal testing experiments, implement a server flag for affecting
the auto time zone detection default setting value when the device
hasn't had an explicit value set.

Implementation notes:

The usual "value is not set so use [flag controlled] default value"
cannot be used; the auto_time_zone global setting cannot be left unset.
The setting it is regrettably a public API and could be observed by
other components. Instead, the system keeps a record of whether the
setting value has been set (via selected APIs) in a new (non-public)
global setting (auto_time_zone_explicit).

When the flag is set the system attempts to keep the auto_time_zone
setting value in sync with the current behavior value in case other
things are observing the value.

Manual Testing
==============

The server flag can be set using:

  adb shell cmd device_config put system_time \
    time_zone_detector_auto_detection_enabled_default \
    [true|false]

... and unset using the delete verb of the same command:

  adb shell cmd device_config delete system_time \
    time_zone_detector_auto_detection_enabled_default

The existing setting can be read and set using:

  adb shell settings get global auto_time_zone
  adb shell settings put global auto_time_zone [0|1]

The new setting that controls whether the flag can be used can be
read/set/cleared for manual testing via:

  adb shell settings get global auto_time_zone_explicit
  adb shell settings put global auto_time_zone_explicit 1
  adb shell settings delete global auto_time_zone_explicit

time_zone_detector configuration state and debug logs can be read via:

  adb shell dumpsys time_zone_detector

Test: Manual testing with various scenarios, see above
Test: New test. See associated topic change in cts
Bug: 273403348
Change-Id: I7091d792428bf4884e6802a537e8cb6d8ecb674f
parent c95d515c
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