MCPcopy Create free account
hub / github.com/android/ndk-samples / _init

Function _init

endless-tunnel/app/src/main/cpp/input_util.cpp:38–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36static _getAxisValue_sig _getAxisValue = NULL;
37
38static void _init() {
39 if (_init_done) {
40 return;
41 }
42
43 _init_done = true;
44
45 // look up the AMotionEvent_getAxisValue function
46 void* lib_android;
47 LOGD("Trying to dlopen libandroid.so");
48 if ((lib_android = dlopen("libandroid.so", 0))) {
49 LOGD("Opened libandroid.so, looking for AMotionEvent_getAxisValue.");
50 _getAxisValue =
51 (_getAxisValue_sig)dlsym(lib_android, "AMotionEvent_getAxisValue");
52 LOGD("AMotionEvent_getAxisValue() address is %p", _getAxisValue);
53 } else {
54 LOGD("Failed to open libandroid.so.");
55 }
56}
57
58static int _translate_keycode(int code) {
59 switch (code) {

Callers 1

CookEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected