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 | |
13 import os | 12 import os |
14 | 13 |
15 from pylib import cmd_helper | 14 from pylib import cmd_helper |
16 | 15 |
17 from pylib.utils import reraiser_thread | 16 from pylib.utils import reraiser_thread |
18 from pylib.utils import timeout_retry | 17 from pylib.utils import timeout_retry |
19 | 18 |
20 _DEFAULT_TIMEOUT = 30 | 19 _DEFAULT_TIMEOUT = 30 |
21 _DEFAULT_RETRIES = 2 | 20 _DEFAULT_RETRIES = 2 |
22 | 21 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 """Restarts the adbd daemon with root permissions, if possible. | 413 """Restarts the adbd daemon with root permissions, if possible. |
415 | 414 |
416 Args: | 415 Args: |
417 timeout: (optional) Timeout per try in seconds. | 416 timeout: (optional) Timeout per try in seconds. |
418 retries: (optional) Number of retries to attempt. | 417 retries: (optional) Number of retries to attempt. |
419 """ | 418 """ |
420 output = self._DeviceAdbCmd(['root'], timeout, retries) | 419 output = self._DeviceAdbCmd(['root'], timeout, retries) |
421 if 'cannot' in output: | 420 if 'cannot' in output: |
422 raise CommandFailedError(['root'], output) | 421 raise CommandFailedError(['root'], output) |
423 | 422 |
OLD | NEW |