OLD | NEW |
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 """This module wraps Android's adb tool. | 5 """This module wraps Android's adb tool. |
6 | 6 |
7 This is a thin wrapper around the adb interface. Any additional complexity | 7 This is a thin wrapper around the adb interface. Any additional complexity |
8 should be delegated to a higher level (ex. DeviceUtils). | 8 should be delegated to a higher level (ex. DeviceUtils). |
9 """ | 9 """ |
10 | 10 |
11 import errno | 11 import errno |
| 12 import logging |
12 import os | 13 import os |
13 | 14 |
14 from pylib import cmd_helper | 15 from pylib import cmd_helper |
15 | 16 |
16 from pylib.utils import reraiser_thread | 17 from pylib.utils import reraiser_thread |
17 from pylib.utils import timeout_retry | 18 from pylib.utils import timeout_retry |
18 | 19 |
19 _DEFAULT_TIMEOUT = 30 | 20 _DEFAULT_TIMEOUT = 30 |
20 _DEFAULT_RETRIES = 2 | 21 _DEFAULT_RETRIES = 2 |
21 | 22 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 """Restarts the adbd daemon with root permissions, if possible. | 414 """Restarts the adbd daemon with root permissions, if possible. |
414 | 415 |
415 Args: | 416 Args: |
416 timeout: (optional) Timeout per try in seconds. | 417 timeout: (optional) Timeout per try in seconds. |
417 retries: (optional) Number of retries to attempt. | 418 retries: (optional) Number of retries to attempt. |
418 """ | 419 """ |
419 output = self._DeviceAdbCmd(['root'], timeout, retries) | 420 output = self._DeviceAdbCmd(['root'], timeout, retries) |
420 if 'cannot' in output: | 421 if 'cannot' in output: |
421 raise CommandFailedError(['root'], output) | 422 raise CommandFailedError(['root'], output) |
422 | 423 |
OLD | NEW |