OLD | NEW |
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 Loading... |
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)) |
OLD | NEW |