summaryrefslogtreecommitdiffstats
path: root/build/android
diff options
context:
space:
mode:
authorilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-17 19:21:39 +0000
committerilevy@chromium.org <ilevy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-17 19:21:39 +0000
commitf4fda224135b541a8ffd30d5e5ac05164abccca0 (patch)
tree507bc2dc81a5b5fc90437f7b7bb2351f2843114c /build/android
parent56b7e39e23afb27d956db35b011eccf31a707ffd (diff)
downloadchromium_src-f4fda224135b541a8ffd30d5e5ac05164abccca0.zip
chromium_src-f4fda224135b541a8ffd30d5e5ac05164abccca0.tar.gz
chromium_src-f4fda224135b541a8ffd30d5e5ac05164abccca0.tar.bz2
Fix calls to ls /root that might be empty
- My earlier CL https://chromiumcodereview.appspot.com/10823382 is problematic. This mostly reverts it and fixes the issue in a better way. Review URL: https://chromiumcodereview.appspot.com/10827403 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android')
-rw-r--r--build/android/pylib/android_commands.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index f030424..72cacdd 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -223,8 +223,6 @@ class AndroidCommands(object):
self._adb = adb_interface.AdbInterface()
if device:
self._adb.SetTargetSerial(device)
- root_test_output = self.RunShellCommand('ls /root')[0]
- self._root_enabled = not 'Permission denied' in root_test_output
self._logcat = None
self._original_governor = None
self._pushed_files = []
@@ -234,13 +232,10 @@ class AndroidCommands(object):
"""Returns our AdbInterface to avoid us wrapping all its methods."""
return self._adb
- def EnableAdbRoot(self):
- self._root_enabled = self.Adb().EnableAdbRoot()
- self._adb.SendCommand('wait-for-device')
-
def IsRootEnabled(self):
- """Returns whether or not _adb.EnabledAdbRoot() has succeeded."""
- return self._root_enabled
+ """Checks if root is enabled on the device."""
+ root_test_output = self.RunShellCommand('ls /root') or ['']
+ return not 'Permission denied' in root_test_output[0]
def GetDeviceYear(self):
"""Returns the year information of the date on device."""