OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 | 9 |
10 import collections | 10 import collections |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
458 reboots_left -= 1 | 458 reboots_left -= 1 |
459 | 459 |
460 def MakeSystemFolderWritable(self): | 460 def MakeSystemFolderWritable(self): |
461 """Remounts the /system folder rw.""" | 461 """Remounts the /system folder rw.""" |
462 out = self._adb.SendCommand('remount') | 462 out = self._adb.SendCommand('remount') |
463 if out.strip() != 'remount succeeded': | 463 if out.strip() != 'remount succeeded': |
464 raise errors.MsgException('Remount failed: %s' % out) | 464 raise errors.MsgException('Remount failed: %s' % out) |
465 | 465 |
466 def RestartAdbdOnDevice(self): | 466 def RestartAdbdOnDevice(self): |
467 logging.info('Killing adbd on the device...') | 467 logging.info('Killing adbd on the device...') |
468 self._adb.SendCommand('wait-for-device') | |
tonyg
2013/11/25 15:46:33
While I love the fix, it seems misplaced to me.
T
Primiano Tucci (use gerrit)
2013/11/25 17:26:51
Right, I should have added more context, my bad.
T
bulach
2013/11/27 12:10:53
I agree this is misplaced and StartAdbServer's pgr
Primiano Tucci (use gerrit)
2013/11/27 15:14:41
Oh right, I got lost in the many layers. makes per
| |
468 adb_pids = self.KillAll('adbd', signal=signal.SIGTERM, with_su=True) | 469 adb_pids = self.KillAll('adbd', signal=signal.SIGTERM, with_su=True) |
469 assert adb_pids, 'Unable to obtain adbd pid' | 470 assert adb_pids, 'Unable to obtain adbd pid' |
470 logging.info('Waiting for device to settle...') | 471 logging.info('Waiting for device to settle...') |
471 self._adb.SendCommand('wait-for-device') | 472 self._adb.SendCommand('wait-for-device') |
472 | 473 |
473 def RestartAdbServer(self): | 474 def RestartAdbServer(self): |
474 """Restart the adb server.""" | 475 """Restart the adb server.""" |
475 ret = self.KillAdbServer() | 476 ret = self.KillAdbServer() |
476 if ret != 0: | 477 if ret != 0: |
477 raise errors.MsgException('KillAdbServer: %d' % ret) | 478 raise errors.MsgException('KillAdbServer: %d' % ret) |
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1703 """ | 1704 """ |
1704 def __init__(self, output): | 1705 def __init__(self, output): |
1705 self._output = output | 1706 self._output = output |
1706 | 1707 |
1707 def write(self, data): | 1708 def write(self, data): |
1708 data = data.replace('\r\r\n', '\n') | 1709 data = data.replace('\r\r\n', '\n') |
1709 self._output.write(data) | 1710 self._output.write(data) |
1710 | 1711 |
1711 def flush(self): | 1712 def flush(self): |
1712 self._output.flush() | 1713 self._output.flush() |
OLD | NEW |