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

Unified Diff: tools/android/mempressure.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
Index: tools/android/mempressure.py
diff --git a/tools/android/mempressure.py b/tools/android/mempressure.py
index 82fe2206dfd252bf04f9cd05ceaca8a569f578b0..77f45a9e1cf426d2cfdda0c3c0c820e3592c1375 100755
--- a/tools/android/mempressure.py
+++ b/tools/android/mempressure.py
@@ -4,6 +4,7 @@
# found in the LICENSE file.
import collections
+import logging
import optparse
import os
import sys
@@ -86,7 +87,13 @@ def main(argv):
device = device_utils.DeviceUtils(None)
- device.old_interface.EnableAdbRoot()
+ try:
+ device.EnableRoot()
+ except device_errors.CommandFailedError as e:
+ # Try to change the flags and start the activity anyway.
+ # TODO(jbudorick) Handle this exception appropriately after interface
+ # conversions are finished.
+ logging.error(str(e))
flags = flag_changer.FlagChanger(device, package_info.cmdline_file)
if ENABLE_TEST_INTENTS_FLAG not in flags.Get():
flags.AddFlags([ENABLE_TEST_INTENTS_FLAG])
« no previous file with comments | « build/android/pylib/valgrind_tools.py ('k') | tools/memory_inspector/memory_inspector/backends/android/android_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698