| Index: devil/devil/android/device_utils.py
|
| diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py
|
| index ef2f08ac0f0cafad01fbb89bb0d02e2f1d46a155..7b838406c42808d31ebcabe911fea1b470dc882c 100644
|
| --- a/devil/devil/android/device_utils.py
|
| +++ b/devil/devil/android/device_utils.py
|
| @@ -714,7 +714,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
|
| @@ -751,6 +751,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,
|
| @@ -825,9 +826,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:
|
|
|