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

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
« no previous file with comments | « 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..5ddfd35ab4db15723a963ae0188382e664aeb540 100644
--- a/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
+++ b/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
@@ -11,6 +11,7 @@ import datetime
import glob
import hashlib
import json
+import logging
import os
import posixpath
@@ -26,6 +27,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 +175,13 @@ 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 as e:
+ # Try to deploy memdump and ps_ext anyway.
+ # TODO(jbudorick) Handle this exception appropriately after interface
+ # conversions are finished.
+ logging.error(str(e))
# Download (from GCS) and deploy prebuilt helper binaries on the device.
self._DeployPrebuiltOnDeviceIfNeeded(_MEMDUMP_PREBUILT_PATH,
« no previous file with comments | « tools/android/mempressure.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698