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 _LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db' | 9 _LOCK_SCREEN_SETTINGS_PATH = '/data/system/locksettings.db' |
10 PASSWORD_QUALITY_UNSPECIFIED = '0' | 10 PASSWORD_QUALITY_UNSPECIFIED = '0' |
(...skipping 18 matching lines...) Expand all Loading... |
29 sdk_version = int(device.GetProp('ro.build.version.sdk')) | 29 sdk_version = int(device.GetProp('ro.build.version.sdk')) |
30 except ValueError: | 30 except ValueError: |
31 logging.error('Skipping content settings configuration, unknown sdk %s', | 31 logging.error('Skipping content settings configuration, unknown sdk %s', |
32 device.GetProp('ro.build.version.sdk')) | 32 device.GetProp('ro.build.version.sdk')) |
33 return | 33 return |
34 | 34 |
35 if sdk_version < 16: | 35 if sdk_version < 16: |
36 logging.error('Skipping content settings configuration due to outdated sdk') | 36 logging.error('Skipping content settings configuration due to outdated sdk') |
37 return | 37 return |
38 | 38 |
39 device.SetProp('persist.sys.usb.config', 'adb') | |
40 device.old_interface.WaitForDevicePm() | |
41 | |
42 if device.GetProp('ro.build.type') == 'userdebug': | 39 if device.GetProp('ro.build.type') == 'userdebug': |
43 for table, key_value in desired_settings: | 40 for table, key_value in desired_settings: |
44 settings = content_settings.ContentSettings(table, device) | 41 settings = content_settings.ContentSettings(table, device) |
45 for key, value in key_value: | 42 for key, value in key_value: |
46 settings[key] = value | 43 settings[key] = value |
47 logging.info('\n%s %s', table, (80 - len(table)) * '-') | 44 logging.info('\n%s %s', table, (80 - len(table)) * '-') |
48 for key, value in sorted(settings.iteritems()): | 45 for key, value in sorted(settings.iteritems()): |
49 logging.info('\t%s: %s', key, value) | 46 logging.info('\t%s: %s', key, value) |
50 | 47 |
51 | 48 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 ('user_rotation', 0), | 170 ('user_rotation', 0), |
174 ]), | 171 ]), |
175 ] | 172 ] |
176 | 173 |
177 NETWORK_DISABLED_SETTINGS = [ | 174 NETWORK_DISABLED_SETTINGS = [ |
178 ('settings/global', [ | 175 ('settings/global', [ |
179 ('airplane_mode_on', 1), | 176 ('airplane_mode_on', 1), |
180 ('wifi_on', 0), | 177 ('wifi_on', 0), |
181 ]), | 178 ]), |
182 ] | 179 ] |
OLD | NEW |