Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: build/android/pylib/device/device_utils.py

Issue 1134773002: [Android] Update SendKeyEvent docs to point to constants.keyevent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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=unused-argument 9 # pylint: disable=unused-argument
10 10
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 # may never return. 782 # may never return.
783 if ((self.build_version_sdk >= 783 if ((self.build_version_sdk >=
784 constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN_MR2) 784 constants.ANDROID_SDK_VERSION_CODES.JELLY_BEAN_MR2)
785 or self.GetApplicationPath(package)): 785 or self.GetApplicationPath(package)):
786 self.RunShellCommand(['pm', 'clear', package], check_return=True) 786 self.RunShellCommand(['pm', 'clear', package], check_return=True)
787 787
788 @decorators.WithTimeoutAndRetriesFromInstance() 788 @decorators.WithTimeoutAndRetriesFromInstance()
789 def SendKeyEvent(self, keycode, timeout=None, retries=None): 789 def SendKeyEvent(self, keycode, timeout=None, retries=None):
790 """Sends a keycode to the device. 790 """Sends a keycode to the device.
791 791
792 See: http://developer.android.com/reference/android/view/KeyEvent.html 792 See the pylib.constants.keyevent module for suitable keycode values.
793 793
794 Args: 794 Args:
795 keycode: A integer keycode to send to the device. 795 keycode: A integer keycode to send to the device.
796 timeout: timeout in seconds 796 timeout: timeout in seconds
797 retries: number of retries 797 retries: number of retries
798 798
799 Raises: 799 Raises:
800 CommandTimeoutError on timeout. 800 CommandTimeoutError on timeout.
801 DeviceUnreachableError on missing device. 801 DeviceUnreachableError on missing device.
802 """ 802 """
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 blacklist = device_blacklist.ReadBlacklist() 1614 blacklist = device_blacklist.ReadBlacklist()
1615 def blacklisted(adb): 1615 def blacklisted(adb):
1616 if adb.GetDeviceSerial() in blacklist: 1616 if adb.GetDeviceSerial() in blacklist:
1617 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial()) 1617 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
1618 return True 1618 return True
1619 return False 1619 return False
1620 1620
1621 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices() 1621 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices()
1622 if not blacklisted(adb)] 1622 if not blacklisted(adb)]
1623 1623
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698