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

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

Issue 371813005: [Android] Switch to DeviceUtils versions of Ls, SetJavaAsserts, GetProp, and SetProp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: 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 8fcfebf36a5572c1e1d4a3a4a02a02545796f2b4..bf10d5d969c54fa48dbf010425790430153aa24c 100644
--- a/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
+++ b/tools/memory_inspector/memory_inspector/backends/android/android_backend.py
@@ -166,7 +166,7 @@ class AndroidDevice(backends.Device):
settings=backends.Settings(AndroidDevice._SETTINGS_KEYS))
self.underlying_device = underlying_device
self._id = underlying_device.old_interface.GetDevice()
- self._name = underlying_device.old_interface.GetProductModel()
+ self._name = underlying_device.GetProp('ro.product.model')
self._sys_stats = None
self._last_device_stats = None
self._sys_stats_last_update = None
@@ -192,15 +192,14 @@ class AndroidDevice(backends.Device):
def IsNativeTracingEnabled(self):
"""Checks for the libc.debug.malloc system property."""
- return bool(self.underlying_device.old_interface.system_properties[
- _DLMALLOC_DEBUG_SYSPROP])
+ return bool(self.underlying_device.GetProp(
+ _DLMALLOC_DEBUG_SYSPROP))
def EnableNativeTracing(self, enabled):
"""Enables libc.debug.malloc and restarts the shell."""
assert(self._initialized)
prop_value = '1' if enabled else ''
- self.underlying_device.old_interface.system_properties[
- _DLMALLOC_DEBUG_SYSPROP] = prop_value
+ self.underlying_device.SetProp(_DLMALLOC_DEBUG_SYSPROP, prop_value)
assert(self.IsNativeTracingEnabled())
# The libc.debug property takes effect only after restarting the Zygote.
self.underlying_device.old_interface.RestartShell()
« no previous file with comments | « tools/android/adb_profile_chrome/chrome_controller.py ('k') | tools/telemetry/telemetry/core/backends/adb_commands.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698