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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py

Issue 99713002: Factor out a system_properties interface for interacting with getprop/setprop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use shlex.split() Created 7 years 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/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
index e3231dad1a3279dd6e812c8e8ce50cb736588d53..fd6ab5ebdec291bafcdf3359f0f8f1800cfeb448 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/tcmalloc_heap_profiler.py
@@ -36,13 +36,9 @@ class _TCMallocHeapProfilerAndroid(object):
# This profiler requires adb root to set properties.
self._browser_backend.adb.Adb().EnableAdbRoot()
for values in properties.itervalues():
- device_property = self._browser_backend.adb.RunShellCommand(
- 'getprop ' + values[0])
- if (not device_property or len(device_property) != 1 or
- not device_property[0].strip()):
- print 'Setting device property ', values[0], values[1]
- self._browser_backend.adb.RunShellCommand(
- 'setprop ' + values[0] + ' ' + str(values[1]))
+ device_property = self._browser_backend.adb.system_properties[values[0]]
+ if not device_property or not device_property.strip():
+ self._browser_backend.adb.system_properties[values[0]] = values[1]
device_configured = True
if not self._browser_backend.adb.Adb().FileExistsOnDevice(
self._DEFAULT_DEVICE_DIR):

Powered by Google App Engine
This is Rietveld 408576698