media/webrtc/trunk/webrtc/build/android/enable_asserts.py
author Daniel Varga <dvarga@mozilla.com>
Fri, 09 Nov 2018 12:22:53 +0200
changeset 445390 981eb3885ff2d2edc9408d44dab9610594a930f7
parent 444311 media/webrtc/trunk/build/android/enable_asserts.py@ef27c14b46bf58f710753ae6bb6d2c01a8c3631f
parent 445272 media/webrtc/trunk/build/android/enable_asserts.py@4989aa9ad7e01e986b90a86f875a23e445564ddd
permissions -rwxr-xr-x
Merge mozilla-central to autoland. a=merge

#!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""Enables dalvik vm asserts in the android device."""

from pylib import android_commands
import optparse
import sys


def main(argv):
  option_parser = optparse.OptionParser()
  option_parser.add_option('--enable_asserts', dest='set_asserts',
      action='store_true', default=None,
      help='Sets the dalvik.vm.enableassertions property to "all"')
  option_parser.add_option('--disable_asserts', dest='set_asserts',
      action='store_false', default=None,
      help='Removes the dalvik.vm.enableassertions property')
  options, _ = option_parser.parse_args(argv)

  commands = android_commands.AndroidCommands()
  if options.set_asserts != None:
    if commands.SetJavaAssertsEnabled(options.set_asserts):
      commands.Reboot(full_reboot=False)


if __name__ == '__main__':
  main(sys.argv)