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

Unified Diff: build/android/pylib/content_settings.py

Issue 333933003: [Android] Switch to DeviceUtils version of RunShellCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/content_settings.py
diff --git a/build/android/pylib/content_settings.py b/build/android/pylib/content_settings.py
index 11bc5fde93e219c8db6f32a6a8746409fc2361d7..54cedfe21a302bc0491dfe07294c893adabc306a 100644
--- a/build/android/pylib/content_settings.py
+++ b/build/android/pylib/content_settings.py
@@ -40,8 +40,8 @@ class ContentSettings(dict):
def iteritems(self):
# Example row:
# 'Row: 0 _id=13, name=logging_id2, value=-1fccbaa546705b05'
- for row in self._device.old_interface.RunShellCommandWithSU(
- 'content query --uri content://%s' % self._table):
+ for row in self._device.RunShellCommand(
+ 'content query --uri content://%s' % self._table, root=True):
fields = row.split(', ')
key = None
value = None
@@ -55,28 +55,31 @@ class ContentSettings(dict):
yield key, value
def __getitem__(self, key):
- return self._device.old_interface.RunShellCommandWithSU(
+ return self._device.RunShellCommand(
'content query --uri content://%s --where "name=\'%s\'" '
- '--projection value' % (self._table, key)).strip()
+ '--projection value' % (self._table, key), root=True).strip()
def __setitem__(self, key, value):
if key in self:
- self._device.old_interface.RunShellCommandWithSU(
+ self._device.RunShellCommand(
'content update --uri content://%s '
'--bind value:%s:%s --where "name=\'%s\'"' % (
self._table,
- self._GetTypeBinding(value), value, key))
+ self._GetTypeBinding(value), value, key),
+ root=True)
else:
- self._device.old_interface.RunShellCommandWithSU(
+ self._device.RunShellCommand(
'content insert --uri content://%s '
'--bind name:%s:%s --bind value:%s:%s' % (
self._table,
self._GetTypeBinding(key), key,
- self._GetTypeBinding(value), value))
+ self._GetTypeBinding(value), value),
+ root=True)
def __delitem__(self, key):
- self._device.old_interface.RunShellCommandWithSU(
+ self._device.RunShellCommand(
'content delete --uri content://%s '
'--bind name:%s:%s' % (
self._table,
- self._GetTypeBinding(key), key))
+ self._GetTypeBinding(key), key),
+ root=True)
« no previous file with comments | « build/android/pylib/android_commands.py ('k') | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698