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

Unified Diff: devil/devil/android/device_utils.py

Issue 2822573002: Fix android_action_runner.InputSwipe and InputText (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: devil/devil/android/device_utils.py
diff --git a/devil/devil/android/device_utils.py b/devil/devil/android/device_utils.py
index 7ba1b51448713b2ae2964d609d3026b76cf3f53f..c32c35d262cf4266f0fa388f1471c5650aa04910 100644
--- a/devil/devil/android/device_utils.py
+++ b/devil/devil/android/device_utils.py
@@ -1190,7 +1190,12 @@ class DeviceUtils(object):
CommandTimeoutError on timeout.
DeviceUnreachableError on missing device.
"""
- cmd = 'p=%s;if [[ "$(ps)" = *$p* ]]; then am force-stop $p; fi'
+ # ps behavior was changed in Android above N, http://crbug.com/686716
+ if (self.build_version_sdk >= version_codes.NOUGAT_MR1
+ and self.build_id[0] > 'N'):
+ cmd = 'p=%s;if [[ "$(ps -e)" = *$p* ]]; then am force-stop $p; fi'
+ else:
+ cmd = 'p=%s;if [[ "$(ps)" = *$p* ]]; then am force-stop $p; fi'
self.RunShellCommand(cmd % package, shell=True, check_return=True)
@decorators.WithTimeoutAndRetriesFromInstance()
« no previous file with comments | « no previous file | devil/devil/android/device_utils_test.py » ('j') | telemetry/telemetry/core/android_action_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698