media/webrtc/trunk/build/android/enable_asserts.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/trunk/build/android/enable_asserts.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +#!/usr/bin/env python
     1.5 +#
     1.6 +# Copyright (c) 2012 The Chromium Authors. All rights reserved.
     1.7 +# Use of this source code is governed by a BSD-style license that can be
     1.8 +# found in the LICENSE file.
     1.9 +
    1.10 +"""Enables dalvik vm asserts in the android device."""
    1.11 +
    1.12 +from pylib import android_commands
    1.13 +import optparse
    1.14 +import sys
    1.15 +
    1.16 +
    1.17 +def main(argv):
    1.18 +  option_parser = optparse.OptionParser()
    1.19 +  option_parser.add_option('--enable_asserts', dest='set_asserts',
    1.20 +      action='store_true', default=None,
    1.21 +      help='Sets the dalvik.vm.enableassertions property to "all"')
    1.22 +  option_parser.add_option('--disable_asserts', dest='set_asserts',
    1.23 +      action='store_false', default=None,
    1.24 +      help='Removes the dalvik.vm.enableassertions property')
    1.25 +  options, _ = option_parser.parse_args(argv)
    1.26 +
    1.27 +  commands = android_commands.AndroidCommands()
    1.28 +  if options.set_asserts != None:
    1.29 +    if commands.SetJavaAssertsEnabled(options.set_asserts):
    1.30 +      commands.Reboot(full_reboot=False)
    1.31 +
    1.32 +
    1.33 +if __name__ == '__main__':
    1.34 +  main(sys.argv)

mercurial