Skip to content

Commit

Permalink
Revert of [Android] Convert RestartAdbd to DeviceUtils. (patchset #3
Browse files Browse the repository at this point in the history
…id:40001 of https://codereview.chromium.org/1100473004/)

Reason for revert:
all perf bots are purple

Original issue's description:
> [Android] Convert RestartAdbd to DeviceUtils.
>
> BUG=267773
>
> Committed: https://crrev.com/598af7c6bd830d6da9182d485842f7ca4e51a6b4
> Cr-Commit-Position: refs/heads/master@{#326304}

TBR=perezju@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=267773

Review URL: https://codereview.chromium.org/1104543003

Cr-Commit-Position: refs/heads/master@{#326357}
  • Loading branch information
jbudorick authored and Commit bot committed Apr 22, 2015
1 parent 43b1dcb commit b209978
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
26 changes: 0 additions & 26 deletions build/android/pylib/device/device_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,6 @@
]


# This must be done in a single shell command.
_RESTART_ADBD_SCRIPT = """
function restart() {
stop adbd
start adbd
}
restart &
"""


@decorators.WithExplicitTimeoutAndRetries(
_DEFAULT_TIMEOUT, _DEFAULT_RETRIES)
def GetAVDs():
Expand Down Expand Up @@ -398,21 +387,6 @@ def wifi_enabled():
if wifi:
timeout_retry.WaitFor(wifi_enabled)

@decorators.WithTimeoutAndRetriesFromInstance()
def RestartAdbd(self, timeout=None, retries=None):
"""Restart adbd on the device.
Args:
timeout: timeout in seconds.
retries: number of retries
Raises:
CommandTimeoutError on timeout.
"""
with device_temp_file.DeviceTempFile(self.adb, suffix='.sh') as tmp:
self.WriteFile(tmp.name, _RESTART_ADBD_SCRIPT)
self.RunShellCommand(['.', tmp.name], as_root=True)
self.adb.WaitForDevice()

REBOOT_DEFAULT_TIMEOUT = 10 * _DEFAULT_TIMEOUT
REBOOT_DEFAULT_RETRIES = _DEFAULT_RETRIES

Expand Down
2 changes: 1 addition & 1 deletion build/android/pylib/perf/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def _LaunchPerfTest(self, test_name):
try:
logging.warning('Unmapping device ports')
forwarder.Forwarder.UnmapAllDevicePorts(self.device)
self.device.RestartAdbd()
self.device.old_interface.RestartAdbdOnDevice()
except Exception as e:
logging.error('Exception when tearing down device %s', e)

Expand Down
2 changes: 1 addition & 1 deletion build/android/pylib/utils/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def CleanupLeftoverProcesses():
device_utils.RestartServer()

def cleanup_device(d):
d.RestartAdbd()
d.old_interface.RestartAdbdOnDevice()
try:
d.EnableRoot()
except device_errors.CommandFailedError as e:
Expand Down

0 comments on commit b209978

Please sign in to comment.