Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: build/android/pylib/device_settings.py

Issue 1127133004: Remove ICS support from build/android/pylib/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 constants 7 from pylib import constants
8 from pylib import content_settings 8 from pylib import content_settings
9 from pylib.device import device_errors 9 from pylib.device import device_errors
10 10
(...skipping 11 matching lines...) Expand all
22 http://developer.android.com/reference/android/provider/Settings.Secure.html 22 http://developer.android.com/reference/android/provider/Settings.Secure.html
23 http://developer.android.com/reference/android/provider/Settings.System.html 23 http://developer.android.com/reference/android/provider/Settings.System.html
24 24
25 Many others are undocumented. 25 Many others are undocumented.
26 26
27 Args: 27 Args:
28 device: A DeviceUtils instance for the device to configure. 28 device: A DeviceUtils instance for the device to configure.
29 desired_settings: A list of (table, [(key: value), ...]) for all 29 desired_settings: A list of (table, [(key: value), ...]) for all
30 settings to configure. 30 settings to configure.
31 """ 31 """
32 try:
33 sdk_version = device.build_version_sdk
34 except device_errors.CommandFailedError as exc:
35 logging.error('Skipping content settings configuration: %s', str(exc))
36 return
37
38 if sdk_version < constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN:
39 logging.error('Skipping content settings configuration due to outdated sdk')
40 return
41
42 if device.build_type == 'userdebug': 32 if device.build_type == 'userdebug':
43 for table, key_value in desired_settings: 33 for table, key_value in desired_settings:
44 settings = content_settings.ContentSettings(table, device) 34 settings = content_settings.ContentSettings(table, device)
45 for key, value in key_value: 35 for key, value in key_value:
46 settings[key] = value 36 settings[key] = value
47 logging.info('\n%s %s', table, (80 - len(table)) * '-') 37 logging.info('\n%s %s', table, (80 - len(table)) * '-')
48 for key, value in sorted(settings.iteritems()): 38 for key, value in sorted(settings.iteritems()):
49 logging.info('\t%s: %s', key, value) 39 logging.info('\t%s: %s', key, value)
50 40
51 41
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 ('user_rotation', 0), 177 ('user_rotation', 0),
188 ]), 178 ]),
189 ] 179 ]
190 180
191 NETWORK_DISABLED_SETTINGS = [ 181 NETWORK_DISABLED_SETTINGS = [
192 ('settings/global', [ 182 ('settings/global', [
193 ('airplane_mode_on', 1), 183 ('airplane_mode_on', 1),
194 ('wifi_on', 0), 184 ('wifi_on', 0),
195 ]), 185 ]),
196 ] 186 ]
OLDNEW
« no previous file with comments | « build/android/pylib/device/device_utils_test.py ('k') | build/android/pylib/gtest/test_package_exe.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698