| 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 import logging | 5 import logging |
| 6 import os | 6 import os |
| 7 import posixpath | 7 import posixpath |
| 8 import re | 8 import re |
| 9 import subprocess | 9 import subprocess |
| 10 import tempfile | 10 import tempfile |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 # Try to get tombstones. | 682 # Try to get tombstones. |
| 683 tombstones = os.path.join(util.GetChromiumSrcDir(), 'build', 'android', | 683 tombstones = os.path.join(util.GetChromiumSrcDir(), 'build', 'android', |
| 684 'tombstones.py') | 684 'tombstones.py') |
| 685 if os.path.exists(tombstones): | 685 if os.path.exists(tombstones): |
| 686 ret += Decorate('Tombstones', | 686 ret += Decorate('Tombstones', |
| 687 subprocess.Popen([tombstones, '-w', '--device', | 687 subprocess.Popen([tombstones, '-w', '--device', |
| 688 self._device.adb.GetDeviceSerial()], | 688 self._device.adb.GetDeviceSerial()], |
| 689 stdout=subprocess.PIPE).communicate()[0]) | 689 stdout=subprocess.PIPE).communicate()[0]) |
| 690 return (True, ret) | 690 return (True, ret) |
| 691 | 691 |
| 692 def GetMinidumpPath(self): |
| 693 return None |
| 694 |
| 692 def IsScreenOn(self): | 695 def IsScreenOn(self): |
| 693 """Determines if device screen is on.""" | 696 """Determines if device screen is on.""" |
| 694 return self._device.IsScreenOn() | 697 return self._device.IsScreenOn() |
| 695 | 698 |
| 696 @staticmethod | 699 @staticmethod |
| 697 def _IsScreenLocked(input_methods): | 700 def _IsScreenLocked(input_methods): |
| 698 """Parser method for IsScreenLocked() | 701 """Parser method for IsScreenLocked() |
| 699 | 702 |
| 700 Args: | 703 Args: |
| 701 input_methods: Output from dumpsys input_methods | 704 input_methods: Output from dumpsys input_methods |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 for process in psutil.process_iter(): | 746 for process in psutil.process_iter(): |
| 744 try: | 747 try: |
| 745 if psutil.version_info >= (2, 0): | 748 if psutil.version_info >= (2, 0): |
| 746 if 'adb' in process.name(): | 749 if 'adb' in process.name(): |
| 747 process.cpu_affinity([0]) | 750 process.cpu_affinity([0]) |
| 748 else: | 751 else: |
| 749 if 'adb' in process.name: | 752 if 'adb' in process.name: |
| 750 process.set_cpu_affinity([0]) | 753 process.set_cpu_affinity([0]) |
| 751 except (psutil.NoSuchProcess, psutil.AccessDenied): | 754 except (psutil.NoSuchProcess, psutil.AccessDenied): |
| 752 logging.warn('Failed to set adb process CPU affinity') | 755 logging.warn('Failed to set adb process CPU affinity') |
| OLD | NEW |