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

Side by Side Diff: tools/android/mempressure.py

Issue 338353004: [Android] Switch KillAll, StartActivity, and BroadcastIntent to DeviceUtils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: appeasing windows Created 6 years, 6 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 logging 7 import logging
8 import optparse 8 import optparse
9 import os 9 import os
10 import sys 10 import sys
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 device.EnableRoot() 91 device.EnableRoot()
92 except device_errors.CommandFailedError as e: 92 except device_errors.CommandFailedError as e:
93 # Try to change the flags and start the activity anyway. 93 # Try to change the flags and start the activity anyway.
94 # TODO(jbudorick) Handle this exception appropriately after interface 94 # TODO(jbudorick) Handle this exception appropriately after interface
95 # conversions are finished. 95 # conversions are finished.
96 logging.error(str(e)) 96 logging.error(str(e))
97 flags = flag_changer.FlagChanger(device, package_info.cmdline_file) 97 flags = flag_changer.FlagChanger(device, package_info.cmdline_file)
98 if ENABLE_TEST_INTENTS_FLAG not in flags.Get(): 98 if ENABLE_TEST_INTENTS_FLAG not in flags.Get():
99 flags.AddFlags([ENABLE_TEST_INTENTS_FLAG]) 99 flags.AddFlags([ENABLE_TEST_INTENTS_FLAG])
100 100
101 device.old_interface.StartActivity(package, activity, action=action) 101 device.StartActivity(intent.Intent(package=package, activity=activity,
102 action=action))
102 103
103 if __name__ == '__main__': 104 if __name__ == '__main__':
104 sys.exit(main(sys.argv)) 105 sys.exit(main(sys.argv))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698