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

Side by Side Diff: build/android/pylib/content_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
« no previous file with comments | « build/android/pylib/constants/__init__.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 from pylib import constants 5 from pylib import constants
6 6
7 7
8 class ContentSettings(dict): 8 class ContentSettings(dict):
9 9
10 """A dict interface to interact with device content settings. 10 """A dict interface to interact with device content settings.
11 11
12 System properties are key/value pairs as exposed by adb shell content. 12 System properties are key/value pairs as exposed by adb shell content.
13 """ 13 """
14 14
15 def __init__(self, table, device): 15 def __init__(self, table, device):
16 super(ContentSettings, self).__init__() 16 super(ContentSettings, self).__init__()
17 assert (device.build_version_sdk
18 >= constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN), (
19 'ContentSettings supported only on SDK 16 and later')
20 self._table = table 17 self._table = table
21 self._device = device 18 self._device = device
22 19
23 @staticmethod 20 @staticmethod
24 def _GetTypeBinding(value): 21 def _GetTypeBinding(value):
25 if isinstance(value, bool): 22 if isinstance(value, bool):
26 return 'b' 23 return 'b'
27 if isinstance(value, float): 24 if isinstance(value, float):
28 return 'f' 25 return 'f'
29 if isinstance(value, int): 26 if isinstance(value, int):
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 self._GetTypeBinding(value), value), 73 self._GetTypeBinding(value), value),
77 as_root=True) 74 as_root=True)
78 75
79 def __delitem__(self, key): 76 def __delitem__(self, key):
80 self._device.RunShellCommand( 77 self._device.RunShellCommand(
81 'content delete --uri content://%s ' 78 'content delete --uri content://%s '
82 '--bind name:%s:%s' % ( 79 '--bind name:%s:%s' % (
83 self._table, 80 self._table,
84 self._GetTypeBinding(key), key), 81 self._GetTypeBinding(key), key),
85 as_root=True) 82 as_root=True)
OLDNEW
« no previous file with comments | « build/android/pylib/constants/__init__.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698