Android: Add a progress dialog for disc image conversion

This commit is contained in:
JosJuice 2020-06-25 19:38:02 +02:00
parent 7d6debb907
commit d9f3e382fe
7 changed files with 127 additions and 20 deletions

View file

@ -36,6 +36,9 @@ static jclass s_ini_file_section_class;
static jfieldID s_ini_file_section_pointer;
static jmethodID s_ini_file_section_constructor;
static jclass s_compress_cb_class;
static jmethodID s_compress_cb_run;
namespace IDCache
{
JNIEnv* GetEnvForThread()
@ -161,6 +164,16 @@ jmethodID GetIniFileSectionConstructor()
return s_ini_file_section_constructor;
}
jclass GetCompressCallbackClass()
{
return s_compress_cb_class;
}
jmethodID GetCompressCallbackRun()
{
return s_compress_cb_run;
}
} // namespace IDCache
#ifdef __cplusplus
@ -223,6 +236,11 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
s_linked_hash_map_put = env->GetMethodID(
s_linked_hash_map_class, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
const jclass compress_cb_class =
env->FindClass("org/dolphinemu/dolphinemu/utils/CompressCallback");
s_compress_cb_class = reinterpret_cast<jclass>(env->NewGlobalRef(compress_cb_class));
s_compress_cb_run = env->GetMethodID(s_compress_cb_class, "run", "(Ljava/lang/String;F)Z");
return JNI_VERSION;
}
@ -239,6 +257,7 @@ void JNI_OnUnload(JavaVM* vm, void* reserved)
env->DeleteGlobalRef(s_linked_hash_map_class);
env->DeleteGlobalRef(s_ini_file_class);
env->DeleteGlobalRef(s_ini_file_section_class);
env->DeleteGlobalRef(s_compress_cb_class);
}
#ifdef __cplusplus