| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Enables dalvik vm asserts in the android device.""" | 7 """Enables dalvik vm asserts in the android device.""" |
| 8 | 8 |
| 9 import argparse | 9 import argparse |
| 10 import sys | 10 import sys |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 if args.blacklist_file | 35 if args.blacklist_file |
| 36 else None) | 36 else None) |
| 37 | 37 |
| 38 # TODO(jbudorick): Accept optional serial number and run only for the | 38 # TODO(jbudorick): Accept optional serial number and run only for the |
| 39 # specified device when present. | 39 # specified device when present. |
| 40 devices = device_utils.DeviceUtils.parallel( | 40 devices = device_utils.DeviceUtils.parallel( |
| 41 device_utils.DeviceUtils.HealthyDevices(blacklist)) | 41 device_utils.DeviceUtils.HealthyDevices(blacklist)) |
| 42 | 42 |
| 43 def set_java_asserts_and_restart(device): | 43 def set_java_asserts_and_restart(device): |
| 44 if device.SetJavaAsserts(args.set_asserts): | 44 if device.SetJavaAsserts(args.set_asserts): |
| 45 device.RunShellCommand('stop') | 45 device.RunShellCommand(['stop'], check_return=True) |
| 46 device.RunShellCommand('start') | 46 device.RunShellCommand(['start'], check_return=True) |
| 47 | 47 |
| 48 devices.pMap(set_java_asserts_and_restart) | 48 devices.pMap(set_java_asserts_and_restart) |
| 49 return 0 | 49 return 0 |
| 50 | 50 |
| 51 | 51 |
| 52 if __name__ == '__main__': | 52 if __name__ == '__main__': |
| 53 sys.exit(main()) | 53 sys.exit(main()) |
| OLD | NEW |