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

Side by Side 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import collections 6 import collections
7 import optparse 7 import optparse
8 import os 8 import os
9 import sys 9 import sys
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 if not options.browser in constants.PACKAGE_INFO.keys(): 79 if not options.browser in constants.PACKAGE_INFO.keys():
80 option_parser.error('Unknown browser option ' + options.browser) 80 option_parser.error('Unknown browser option ' + options.browser)
81 81
82 package_info = constants.PACKAGE_INFO[options.browser] 82 package_info = constants.PACKAGE_INFO[options.browser]
83 83
84 package = package_info.package 84 package = package_info.package
85 activity = package_info.activity 85 activity = package_info.activity
86 86
87 device = device_utils.DeviceUtils(None) 87 device = device_utils.DeviceUtils(None)
88 88
89 device.old_interface.EnableAdbRoot() 89 try:
90 device.EnableRoot()
91 except device_errors.CommandFailedError:
92 # Try to change the flags and start the activity anyway.
93 pass
90 flags = flag_changer.FlagChanger(device, package_info.cmdline_file) 94 flags = flag_changer.FlagChanger(device, package_info.cmdline_file)
91 if ENABLE_TEST_INTENTS_FLAG not in flags.Get(): 95 if ENABLE_TEST_INTENTS_FLAG not in flags.Get():
92 flags.AddFlags([ENABLE_TEST_INTENTS_FLAG]) 96 flags.AddFlags([ENABLE_TEST_INTENTS_FLAG])
93 97
94 device.old_interface.StartActivity(package, activity, action=action) 98 device.old_interface.StartActivity(package, activity, action=action)
95 99
96 if __name__ == '__main__': 100 if __name__ == '__main__':
97 sys.exit(main(sys.argv)) 101 sys.exit(main(sys.argv))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698