Index: tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py |
diff --git a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py |
index abe17a9e70b0132d94b3fbea2214873c5fcf8e31..8be729edcd83188fbeec9fac3b02e4cdb83109ca 100644 |
--- a/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py |
+++ b/tools/telemetry/telemetry/core/backends/chrome/android_browser_backend.py |
@@ -205,7 +205,7 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend): |
self._adb.device().SetProp('socket.relaxsslcheck', 'yes') |
# Kill old browser. |
- self._adb.device().ForceStop(self._backend_settings.package) |
+ self._KillBrowser() |
if self._adb.device().old_interface.CanAccessProtectedFileContents(): |
if self.browser_options.profile_dir: |
@@ -229,6 +229,13 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend): |
self._adb.device().RunShellCommand( |
'am set-debug-app --persistent %s' % self._backend_settings.package) |
+ def _KillBrowser(self): |
+ # We use KillAll rather than ForceStop for efficiency reasons. |
+ try: |
+ self._adb.device().KillAll(self._backend_settings.package, retries=0) |
+ except device_errors.CommandFailedError: |
+ pass |
+ |
def _SetUpCommandLine(self): |
def QuoteIfNeeded(arg): |
# Escape 'key=valueA valueB' to 'key="valueA valueB"' |
@@ -373,7 +380,7 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend): |
def Close(self): |
super(AndroidBrowserBackend, self).Close() |
- self._adb.device().ForceStop(self._backend_settings.package) |
+ self._KillBrowser() |
# Restore android.net SSL check |
if self._backend_settings.relax_ssl_check: |