Commit 4acdadac authored by navabi@chromium.org's avatar navabi@chromium.org

Add option to provision_devices script to disable location.

BUG=385379,379219
R=tedchoc@chromium.org

Review URL: https://codereview.chromium.org/348673003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278556 0039d316-1c4b-4281-b951-d872f2087c98
parent c99a81df
......@@ -146,8 +146,12 @@ def ProvisionDevices(options):
device = device_utils.DeviceUtils(device_serial)
device.old_interface.EnableAdbRoot()
_ConfigureLocalProperties(device)
device_settings.ConfigureContentSettingsDict(
device, device_settings.DETERMINISTIC_DEVICE_SETTINGS)
device_settings_map = device_settings.DETERMINISTIC_DEVICE_SETTINGS
if options.disable_location:
device_settings_map.update(device_settings.DISABLE_LOCATION_SETTING)
else:
device_settings_map.update(device_settings.ENABLE_LOCATION_SETTING)
device_settings.ConfigureContentSettingsDict(device, device_settings_map)
if 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower():
# TODO(tonyg): We eventually want network on. However, currently radios
# can cause perfbots to drain faster than they charge.
......@@ -195,6 +199,8 @@ def main(argv):
parser = optparse.OptionParser()
parser.add_option('--skip-wipe', action='store_true', default=False,
help="Don't wipe device data during provisioning.")
parser.add_option('--disable-location', action='store_true', default=False,
help="Disallow Google location services on devices.")
parser.add_option('-d', '--device',
help='The serial number of the device to be provisioned')
parser.add_option('-t', '--target', default='Debug', help='The build target')
......
......@@ -47,6 +47,20 @@ def ConfigureContentSettingsDict(device, desired_settings):
logging.info('\t%s: %s', key, value)
ENABLE_LOCATION_SETTING = {
'settings/secure': {
# Ensure Geolocation is enabled and allowed for tests.
'location_providers_allowed': 'gps,network',
}
}
DISABLE_LOCATION_SETTING = {
'settings/secure': {
# Ensure Geolocation is disabled.
'location_providers_allowed': '',
}
}
DETERMINISTIC_DEVICE_SETTINGS = {
'com.google.settings/partner': {
'network_location_opt_in': 0,
......@@ -83,9 +97,6 @@ DETERMINISTIC_DEVICE_SETTINGS = {
# receives the injected user input events).
'anr_show_background': 0,
# Ensure Geolocation is enabled and allowed for tests.
'location_providers_allowed': 'gps,network',
'lockscreen.disabled': 1,
'screensaver_enabled': 0,
......
Markdown is supported
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