| 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 17 matching lines...) Expand all Loading... |
| 28 except ValueError: | 28 except ValueError: |
| 29 logging.error('Skipping content settings configuration, unknown sdk %s', | 29 logging.error('Skipping content settings configuration, unknown sdk %s', |
| 30 device.old_interface.system_properties[ | 30 device.old_interface.system_properties[ |
| 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' |
| 39 device.old_interface.WaitForDevicePm() |
| 40 |
| 38 for table, key_value in sorted(desired_settings.iteritems()): | 41 for table, key_value in sorted(desired_settings.iteritems()): |
| 39 settings = content_settings.ContentSettings(table, device) | 42 settings = content_settings.ContentSettings(table, device) |
| 40 for key, value in key_value.iteritems(): | 43 for key, value in key_value.iteritems(): |
| 41 settings[key] = value | 44 settings[key] = value |
| 42 logging.info('\n%s %s', table, (80 - len(table)) * '-') | 45 logging.info('\n%s %s', table, (80 - len(table)) * '-') |
| 43 for key, value in sorted(settings.iteritems()): | 46 for key, value in sorted(settings.iteritems()): |
| 44 logging.info('\t%s: %s', key, value) | 47 logging.info('\t%s: %s', key, value) |
| 45 | 48 |
| 46 | 49 |
| 47 DETERMINISTIC_DEVICE_SETTINGS = { | 50 DETERMINISTIC_DEVICE_SETTINGS = { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 }, | 105 }, |
| 103 } | 106 } |
| 104 | 107 |
| 105 | 108 |
| 106 NETWORK_DISABLED_SETTINGS = { | 109 NETWORK_DISABLED_SETTINGS = { |
| 107 'settings/global': { | 110 'settings/global': { |
| 108 'airplane_mode_on': 1, | 111 'airplane_mode_on': 1, |
| 109 'wifi_on': 0, | 112 'wifi_on': 0, |
| 110 }, | 113 }, |
| 111 } | 114 } |
| OLD | NEW |