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

Unified Diff: tools/memory_inspector/memory_inspector/backends/android/android_backend.py

Issue 285143002: [Android] Convert to DeviceUtils versions of IsOnline, HasRoot, and EnableRoot. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« build/android/pylib/valgrind_tools.py ('K') | « tools/android/mempressure.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/memory_inspector/memory_inspector/backends/android/android_backend.py
diff --git a/tools/memory_inspector/memory_inspector/backends/android/android_backend.py b/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
index 4bae745d171c7f72e388dc2c1a2c62dbac7b4ee7..4ab38e84da64568717c06fdfacd78011fd5f2217 100644
--- a/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
+++ b/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
@@ -26,6 +26,7 @@ from memory_inspector.core import symbol
# The memory_inspector/__init__ module will add the <CHROME_SRC>/build/android
# deps to the PYTHONPATH for pylib.
from pylib import android_commands
+from pylib.device import device_errors
from pylib.device import device_utils
from pylib.symbols import elf_symbolizer
@@ -173,7 +174,11 @@ class AndroidDevice(backends.Device):
def Initialize(self):
"""Starts adb root and deploys the prebuilt binaries on initialization."""
- self.underlying_device.old_interface.EnableAdbRoot()
+ try:
+ self.underlying_device.EnableRoot()
+ except device_errors.CommandFailedError:
+ # Try to deploy memdump and ps_ext anyway.
+ pass
# Download (from GCS) and deploy prebuilt helper binaries on the device.
self._DeployPrebuiltOnDeviceIfNeeded(_MEMDUMP_PREBUILT_PATH,
« build/android/pylib/valgrind_tools.py ('K') | « tools/android/mempressure.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698