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 from pylib import constants | |
6 | |
7 | 5 |
8 class ContentSettings(dict): | 6 class ContentSettings(dict): |
9 | 7 |
10 """A dict interface to interact with device content settings. | 8 """A dict interface to interact with device content settings. |
11 | 9 |
12 System properties are key/value pairs as exposed by adb shell content. | 10 System properties are key/value pairs as exposed by adb shell content. |
13 """ | 11 """ |
14 | 12 |
15 def __init__(self, table, device): | 13 def __init__(self, table, device): |
16 super(ContentSettings, self).__init__() | 14 super(ContentSettings, self).__init__() |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 self._GetTypeBinding(value), value), | 71 self._GetTypeBinding(value), value), |
74 as_root=True) | 72 as_root=True) |
75 | 73 |
76 def __delitem__(self, key): | 74 def __delitem__(self, key): |
77 self._device.RunShellCommand( | 75 self._device.RunShellCommand( |
78 'content delete --uri content://%s ' | 76 'content delete --uri content://%s ' |
79 '--bind name:%s:%s' % ( | 77 '--bind name:%s:%s' % ( |
80 self._table, | 78 self._table, |
81 self._GetTypeBinding(key), key), | 79 self._GetTypeBinding(key), key), |
82 as_root=True) | 80 as_root=True) |
OLD | NEW |