use handle_cache for Looper methods

These methods need to be called very often
This commit is contained in:
Julian Winkler
2023-10-08 15:31:55 +02:00
parent a29ba61f30
commit 23c0b006ef
3 changed files with 11 additions and 5 deletions

View File

@@ -137,6 +137,9 @@ void set_up_handle_cache(JNIEnv *env)
handle_cache.application.class = _REF((*env)->FindClass(env, "android/app/Application"));
handle_cache.application.get_app_icon_path = _METHOD(handle_cache.application.class, "get_app_icon_path", "()Ljava/lang/String;");
handle_cache.looper.class = _REF((*env)->FindClass(env, "android/os/Looper"));
handle_cache.looper.loop = _STATIC_METHOD(handle_cache.looper.class, "loop", "()V");
handle_cache.looper.prepareMainLooper = _STATIC_METHOD(handle_cache.looper.class, "prepareMainLooper", "()V");
}
void extract_from_apk(const char *path, const char *target) {