OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Provides an interface to start and stop Android emulator. | 5 """Provides an interface to start and stop Android emulator. |
6 | 6 |
7 Assumes system environment ANDROID_NDK_ROOT has been set. | |
8 | |
9 Emulator: The class provides the methods to launch/shutdown the emulator with | 7 Emulator: The class provides the methods to launch/shutdown the emulator with |
10 the android virtual device named 'avd_armeabi' . | 8 the android virtual device named 'avd_armeabi' . |
11 """ | 9 """ |
12 | 10 |
13 import logging | 11 import logging |
14 import os | 12 import os |
15 import signal | 13 import signal |
16 import subprocess | 14 import subprocess |
17 import time | 15 import time |
18 | 16 |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 logging.critical('emulator _ShutdownOnSignal') | 431 logging.critical('emulator _ShutdownOnSignal') |
434 for sig in self._SIGNALS: | 432 for sig in self._SIGNALS: |
435 signal.signal(sig, signal.SIG_DFL) | 433 signal.signal(sig, signal.SIG_DFL) |
436 self.Shutdown() | 434 self.Shutdown() |
437 raise KeyboardInterrupt # print a stack | 435 raise KeyboardInterrupt # print a stack |
438 | 436 |
439 def _InstallKillHandler(self): | 437 def _InstallKillHandler(self): |
440 """Install a handler to kill the emulator when we exit unexpectedly.""" | 438 """Install a handler to kill the emulator when we exit unexpectedly.""" |
441 for sig in self._SIGNALS: | 439 for sig in self._SIGNALS: |
442 signal.signal(sig, self._ShutdownOnSignal) | 440 signal.signal(sig, self._ShutdownOnSignal) |
OLD | NEW |