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

Add shell commands and other support for host CTS

Host CTS tests are needed for metrics approval. The added shell commands
enable tests to assert LocationTimeZoneManager behavior / internal
states.

location_time_zone_manager:

The location time zone manager can be set into a mode where it records
provider state changes. It can also dump its state on request as a
proto. This will enable the impact of commands made during tests to be
asserted.

Example usages:

A command to start recording state changes:

$ adb shell cmd location_time_zone_manager record_provider_states true

A command to dump the manager's state:

$ adb shell cmd location_time_zone_manager dump_state

(--proto can be used to obtain a binary proto representation of the
state, easier for parsing / manipulating during tests than text output).

This commit also switches to using shell commands to set providers into
"simulated" and "disabled" mode. Previously this was handled with system
properties (requiring an -eng build) and a reboot to take effect. Now
it is achieved via the set_provider_mode_override shell command, is
non-persistent, and it leverages the new shell commands that can be used
to stop / start the location_time_zone_manager service.

time_zone_detector:

New commands have been added to query and modify higher-level time
zone-related settings for host tests:

+ is_auto_detection_enabled
+ set_auto_detection_enabled
+ is_geo_detection_supported
+ is_location_enabled
+ is_geo_detection_enabled
+ set_geo_detection_enabled

See also for help:

$ adb shell cmd location_time_zone_manager
$ adb shell cmd time_zone_detector

Bug: 172934905
Test: atest services/tests/servicestests/src/com/android/server/location/timezone/
Test: atest CtsLocationTimeZoneManagerHostTest
Change-Id: I318d82f292f48fa5bb106f84104c4856f7ef6e1c
parent 1d30d73d
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