| Index: build/android/pylib/device/device_utils.py
|
| diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
|
| index f4bce41f2d660d5d1b843fe9b69d126436ebfc60..f6bebcebe98c9b2f6c98b725d27be6da22f1f6c3 100644
|
| --- a/build/android/pylib/device/device_utils.py
|
| +++ b/build/android/pylib/device/device_utils.py
|
| @@ -215,9 +215,6 @@ class DeviceUtils(object):
|
| CommandTimeoutError on timeout.
|
| DeviceUnreachableError on missing device.
|
| """
|
| - return self._GetExternalStoragePathImpl()
|
| -
|
| - def _GetExternalStoragePathImpl(self):
|
| if 'external_storage' in self._cache:
|
| return self._cache['external_storage']
|
|
|
| @@ -285,7 +282,8 @@ class DeviceUtils(object):
|
| return self.GetProp('sys.boot_completed') == '1'
|
|
|
| def wifi_enabled():
|
| - return 'Wi-Fi is enabled' in self.RunShellCommand(['dumpsys', 'wifi'])
|
| + return 'Wi-Fi is enabled' in self.RunShellCommand(['dumpsys', 'wifi'],
|
| + check_return=False)
|
|
|
| self.adb.WaitForDevice()
|
| timeout_retry.WaitFor(sd_card_ready)
|
| @@ -442,7 +440,7 @@ class DeviceUtils(object):
|
| timeout = self._default_timeout
|
|
|
| try:
|
| - output = self.adb.Shell(cmd, expect_rc=0)
|
| + output = self.adb.Shell(cmd)
|
| except device_errors.AdbShellCommandFailedError as e:
|
| if check_return:
|
| raise
|
| @@ -531,6 +529,22 @@ class DeviceUtils(object):
|
| raise device_errors.CommandFailedError(l, device=str(self))
|
|
|
| @decorators.WithTimeoutAndRetriesFromInstance()
|
| + def StartInstrumentation(self, component, finish=True, raw=False,
|
| + extras=None, timeout=None, retries=None):
|
| + if extras is None:
|
| + extras = {}
|
| +
|
| + cmd = ['am', 'instrument']
|
| + if finish:
|
| + cmd.append('-w')
|
| + if raw:
|
| + cmd.append('-r')
|
| + for k, v in extras.iteritems():
|
| + cmd.extend(['-e', k, v])
|
| + cmd.append(component)
|
| + return self.RunShellCommand(cmd, check_return=True)
|
| +
|
| + @decorators.WithTimeoutAndRetriesFromInstance()
|
| def BroadcastIntent(self, intent, timeout=None, retries=None):
|
| """Send a broadcast intent.
|
|
|
| @@ -768,7 +782,7 @@ class DeviceUtils(object):
|
| zip_proc.start()
|
| zip_proc.join()
|
|
|
| - zip_on_device = '%s/tmp.zip' % self._GetExternalStoragePathImpl()
|
| + zip_on_device = '%s/tmp.zip' % self.GetExternalStoragePath()
|
| try:
|
| self.adb.Push(zip_file.name, zip_on_device)
|
| self.RunShellCommand(
|
|
|