| Index: devil/devil/android/device_utils.py
|
| diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py
|
| index 57c3f81c48c30fde6e46ed56812c249cc979c660..b92a65cfab6dfb6225adc1faf8288ec5ec2b33c9 100644
|
| --- a/devil/devil/android/device_utils.py
|
| +++ b/devil/devil/android/device_utils.py
|
| @@ -713,7 +713,7 @@ class DeviceUtils(object):
|
| @decorators.WithTimeoutAndRetriesFromInstance()
|
| def RunShellCommand(self, cmd, check_return=False, cwd=None, env=None,
|
| as_root=False, single_line=False, large_output=False,
|
| - timeout=None, retries=None):
|
| + timeout=None, retries=None, split_lines=True):
|
| """Run an ADB shell command.
|
|
|
| The command to run |cmd| should be a sequence of program arguments or else
|
| @@ -750,6 +750,7 @@ class DeviceUtils(object):
|
| this large output will be truncated.
|
| timeout: timeout in seconds
|
| retries: number of retries
|
| + split_lines: Whether to split the output into a list of lines.
|
|
|
| Returns:
|
| If single_line is False, the output of the command as a list of lines,
|
| @@ -824,9 +825,12 @@ class DeviceUtils(object):
|
| # "su -c sh -c" allows using shell features in |cmd|
|
| cmd = self._Su('sh -c %s' % cmd_helper.SingleQuote(cmd))
|
|
|
| - output = handle_large_output(cmd, large_output).splitlines()
|
| + output = handle_large_output(cmd, large_output)
|
|
|
| - if single_line:
|
| + if split_lines:
|
| + output = output.splitlines()
|
| +
|
| + if split_lines and single_line:
|
| if not output:
|
| return ''
|
| elif len(output) == 1:
|
|
|