MCPcopy Create free account
hub / github.com/NativeScript/android / Init

Method Init

test-app/runtime/src/main/cpp/Runtime.cpp:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void Runtime::Init(JavaVM* vm, void* reserved) {
95 __android_log_print(ANDROID_LOG_INFO, "TNS.Runtime",
96 "NativeScript Runtime Version %s, commit %s",
97 NATIVE_SCRIPT_RUNTIME_VERSION,
98 NATIVE_SCRIPT_RUNTIME_COMMIT_SHA);
99
100 if (Runtime::s_jvm == nullptr) {
101 s_jvm = vm;
102
103 JEnv::Init(s_jvm);
104 }
105
106 // handle SIGABRT/SIGSEGV only on API level > 20 as the handling is not so
107 // efficient in older versions
108 if (m_androidVersion > 20) {
109 struct sigaction action;
110 action.sa_handler = SIG_handler;
111 sigaction(SIGABRT, &action, NULL);
112 sigaction(SIGSEGV, &action, NULL);
113 }
114 // Set terminate handler for uncaught exceptions
115 std::set_terminate(LogAndAbortUncaught);
116}
117
118int Runtime::GetAndroidVersion() {
119 char sdkVersion[PROP_VALUE_MAX];

Callers 1

PrepareV8RuntimeMethod · 0.45

Calls 2

sigactionClass · 0.85
GetObjectArrayElementMethod · 0.80

Tested by

no test coverage detected