OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import logging | 5 import logging |
6 | 6 |
7 from pylib import content_settings | 7 from pylib import content_settings |
8 | 8 |
9 | 9 |
10 def ConfigureContentSettingsDict(device, desired_settings): | 10 def ConfigureContentSettingsDict(device, desired_settings): |
(...skipping 20 matching lines...) Expand all Loading... | |
31 'ro.build.version.sdk']) | 31 'ro.build.version.sdk']) |
32 return | 32 return |
33 | 33 |
34 if sdk_version < 16: | 34 if sdk_version < 16: |
35 logging.error('Skipping content settings configuration due to outdated sdk') | 35 logging.error('Skipping content settings configuration due to outdated sdk') |
36 return | 36 return |
37 | 37 |
38 device.old_interface.system_properties['persist.sys.usb.config'] = 'adb' | 38 device.old_interface.system_properties['persist.sys.usb.config'] = 'adb' |
39 device.old_interface.WaitForDevicePm() | 39 device.old_interface.WaitForDevicePm() |
40 | 40 |
41 for table, key_value in sorted(desired_settings.iteritems()): | 41 if device.old_interface.GetBuildType() == 'userdebug': |
mstrum
2014/06/24 18:54:35
Could you change this to be != 'user' so it works
| |
42 settings = content_settings.ContentSettings(table, device) | 42 for table, key_value in sorted(desired_settings.iteritems()): |
43 for key, value in key_value.iteritems(): | 43 settings = content_settings.ContentSettings(table, device) |
44 settings[key] = value | 44 for key, value in key_value.iteritems(): |
45 logging.info('\n%s %s', table, (80 - len(table)) * '-') | 45 settings[key] = value |
46 for key, value in sorted(settings.iteritems()): | 46 logging.info('\n%s %s', table, (80 - len(table)) * '-') |
47 logging.info('\t%s: %s', key, value) | 47 for key, value in sorted(settings.iteritems()): |
48 logging.info('\t%s: %s', key, value) | |
48 | 49 |
49 | 50 |
50 ENABLE_LOCATION_SETTING = { | 51 ENABLE_LOCATION_SETTING = { |
51 'settings/secure': { | 52 'settings/secure': { |
52 # Ensure Geolocation is enabled and allowed for tests. | 53 # Ensure Geolocation is enabled and allowed for tests. |
53 'location_providers_allowed': 'gps,network', | 54 'location_providers_allowed': 'gps,network', |
54 } | 55 } |
55 } | 56 } |
56 | 57 |
57 DISABLE_LOCATION_SETTING = { | 58 DISABLE_LOCATION_SETTING = { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 }, | 117 }, |
117 } | 118 } |
118 | 119 |
119 | 120 |
120 NETWORK_DISABLED_SETTINGS = { | 121 NETWORK_DISABLED_SETTINGS = { |
121 'settings/global': { | 122 'settings/global': { |
122 'airplane_mode_on': 1, | 123 'airplane_mode_on': 1, |
123 'wifi_on': 0, | 124 'wifi_on': 0, |
124 }, | 125 }, |
125 } | 126 } |
OLD | NEW |