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

Implement user-scoped geolocation configuration

Implement user-scoped geolocation configuration / behavior.

The main changes:

1) For simplicity, configuration change listener is no longer passed the
latest config. It is left to the listener to request the latest config.
This removes some of the previous complexity that required a SparseArray
to track listeners by userId.

2) The Callback implementation is now responsible for listening for
configuration / user changes and invoking a listener (which will invoke
other listeners). This is to try to have one class know all the various
settings that affect auto time / geolocation detection behavior, which
has become more complicated with the user-scoped geolocation config. The
TimeZoneDetectorInternal has some listener methods added in preparation
for later steps.

3) The new "geolocation detection enabled" setting is added. This allows
users to selectively disable geolocation time zone detection
independently of the location toggle.

4) The TimeZoneConfiguration now carries the ID of the user it is for,
since it now contains user-specific state.

5) Internally, the TimeZoneConfiguration is replaced by the
ConfigurationInternal class, which includes all properties (not just
user visible settings) that influence time zone behavior on the device.
The ConfigurationInternal generates the TimeZoneCapabilities and
TimeZoneConfiguration.

6) In a change from the initial behavior, any previously received
geolocation suggestion is cleared if geolocation detection is turned
off (or the current user switches to one that has it turned off), and
suggestions received when geolocation detection is off are ignored.
This is trying to be careful to avoid caching the geolocation timezone
if the user has signalled they don't want their device to use it.

Test: atest services/tests/servicestests/src/com/android/server/timezonedetector
Test: atest core/tests/coretests/src/android/app/timezonedetector
Bug: 149014708
Change-Id: Ieac9f8f646e16edcb8b6ea6c8749e45761898ac1
parent e076ada0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment