OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 a variety of device interactions based on adb. | 5 """Provides a variety of device interactions based on adb. |
6 | 6 |
7 Eventually, this will be based on adb_wrapper. | 7 Eventually, this will be based on adb_wrapper. |
8 """ | 8 """ |
9 # pylint: disable=W0613 | 9 # pylint: disable=W0613 |
10 | 10 |
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 device. | 727 device. |
728 timeout: timeout in seconds | 728 timeout: timeout in seconds |
729 retries: number of retries | 729 retries: number of retries |
730 | 730 |
731 Raises: | 731 Raises: |
732 CommandTimeoutError on timeout. | 732 CommandTimeoutError on timeout. |
733 """ | 733 """ |
734 self.old_interface.system_properties[property_name] = value | 734 self.old_interface.system_properties[property_name] = value |
735 | 735 |
736 @decorators.WithTimeoutAndRetriesFromInstance() | 736 @decorators.WithTimeoutAndRetriesFromInstance() |
| 737 def GetABI(self, timeout=None, retries=None): |
| 738 """Gets the device main ABI. |
| 739 |
| 740 Args: |
| 741 timeout: timeout in seconds |
| 742 retries: number of retries |
| 743 |
| 744 Returns: |
| 745 The device's main ABI name. |
| 746 |
| 747 Raises: |
| 748 CommandTimeoutError on timeout. |
| 749 """ |
| 750 return self.GetProp('ro.product.cpu.abi') |
| 751 |
| 752 @decorators.WithTimeoutAndRetriesFromInstance() |
737 def GetPids(self, process_name, timeout=None, retries=None): | 753 def GetPids(self, process_name, timeout=None, retries=None): |
738 """Returns the PIDs of processes with the given name. | 754 """Returns the PIDs of processes with the given name. |
739 | 755 |
740 Note that the |process_name| is often the package name. | 756 Note that the |process_name| is often the package name. |
741 | 757 |
742 Args: | 758 Args: |
743 process_name: A string containing the process name to get the PIDs for. | 759 process_name: A string containing the process name to get the PIDs for. |
744 timeout: timeout in seconds | 760 timeout: timeout in seconds |
745 retries: number of retries | 761 retries: number of retries |
746 | 762 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 Returns: | 878 Returns: |
863 A Parallelizer operating over |devices|. | 879 A Parallelizer operating over |devices|. |
864 """ | 880 """ |
865 if not devices or len(devices) == 0: | 881 if not devices or len(devices) == 0: |
866 devices = pylib.android_commands.GetAttachedDevices() | 882 devices = pylib.android_commands.GetAttachedDevices() |
867 parallelizer_type = (parallelizer.Parallelizer if async | 883 parallelizer_type = (parallelizer.Parallelizer if async |
868 else parallelizer.SyncParallelizer) | 884 else parallelizer.SyncParallelizer) |
869 return parallelizer_type([ | 885 return parallelizer_type([ |
870 d if isinstance(d, DeviceUtils) else DeviceUtils(d) | 886 d if isinstance(d, DeviceUtils) else DeviceUtils(d) |
871 for d in devices]) | 887 for d in devices]) |
872 | |
OLD | NEW |