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

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

Issue 11360248: Use the new forwarder2's Daemon implementation in device_forwarder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address David's comments Created 8 years, 1 month 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 | « no previous file | build/android/pylib/forwarder.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 8033bc81e50565edbecf62bb2523e9aa71daf3b9..66f705f4ca378aeb4063c2adbacb2275f483a291 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -466,6 +466,25 @@ class AndroidCommands(object):
logging.info('\n>>> '.join(result))
return result
+ def GetShellCommandStatusAndOutput(self, command, timeout_time=20,
+ log_result=False):
+ """See RunShellCommand() above.
+
+ Returns:
+ The tuple (exit code, list of output lines).
+ """
+ lines = self.RunShellCommand(
+ command + '; echo %$?', timeout_time, log_result)
+ last_line = lines[-1]
+ status_pos = last_line.rfind('%')
+ assert status_pos >= 0
+ status = int(last_line[status_pos + 1:])
+ if status_pos == 0:
+ lines = lines[:-1]
+ else:
+ lines = lines[:-1] + last_line[:status_pos]
+ return (status, lines)
+
def KillAll(self, process):
"""Android version of killall, connected via adb.
« no previous file with comments | « no previous file | build/android/pylib/forwarder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698