summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon/IDCache.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-12-28 13:25:24 +0100
committerJosJuice <josjuice@gmail.com>2020-12-28 21:00:10 +0100
commitd78277c063d43e3234fe80a38d272500f3dfce3a (patch)
treea66fd4f943abb38b4aa47f91a57d7569f0f5be29 /Source/Android/jni/AndroidCommon/IDCache.cpp
parent01b964b01aad3f46611e5fec8c44b60ed04a9b3f (diff)
Android: Add specialized content provider implementation of DoFileSearch
Diffstat (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp')
-rw-r--r--Source/Android/jni/AndroidCommon/IDCache.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp
index a4a7ef4ebb..4c6c4b2ce7 100644
--- a/Source/Android/jni/AndroidCommon/IDCache.cpp
+++ b/Source/Android/jni/AndroidCommon/IDCache.cpp
@@ -10,6 +10,8 @@ static constexpr jint JNI_VERSION = JNI_VERSION_1_6;
static JavaVM* s_java_vm;
+static jclass s_string_class;
+
static jclass s_native_library_class;
static jmethodID s_display_alert_msg;
static jmethodID s_do_rumble;
@@ -47,6 +49,7 @@ static jmethodID s_content_handler_delete;
static jmethodID s_content_handler_get_size_and_is_directory;
static jmethodID s_content_handler_get_display_name;
static jmethodID s_content_handler_get_child_names;
+static jmethodID s_content_handler_do_file_search;
static jclass s_network_helper_class;
static jmethodID s_network_helper_get_network_ip_address;
@@ -78,6 +81,11 @@ JNIEnv* GetEnvForThread()
return owned.env;
}
+jclass GetStringClass()
+{
+ return s_string_class;
+}
+
jclass GetNativeLibraryClass()
{
return s_native_library_class;
@@ -228,6 +236,11 @@ jmethodID GetContentHandlerGetChildNames()
return s_content_handler_get_child_names;
}
+jmethodID GetContentHandlerDoFileSearch()
+{
+ return s_content_handler_do_file_search;
+}
+
jclass GetNetworkHelperClass()
{
return s_network_helper_class;
@@ -262,6 +275,9 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION) != JNI_OK)
return JNI_ERR;
+ const jclass string_class = env->FindClass("java/lang/String");
+ s_string_class = reinterpret_cast<jclass>(env->NewGlobalRef(string_class));
+
const jclass native_library_class = env->FindClass("org/dolphinemu/dolphinemu/NativeLibrary");
s_native_library_class = reinterpret_cast<jclass>(env->NewGlobalRef(native_library_class));
s_display_alert_msg = env->GetStaticMethodID(s_native_library_class, "displayAlertMsg",
@@ -331,6 +347,9 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved)
s_content_handler_class, "getDisplayName", "(Ljava/lang/String;)Ljava/lang/String;");
s_content_handler_get_child_names = env->GetStaticMethodID(
s_content_handler_class, "getChildNames", "(Ljava/lang/String;Z)[Ljava/lang/String;");
+ s_content_handler_do_file_search =
+ env->GetStaticMethodID(s_content_handler_class, "doFileSearch",
+ "(Ljava/lang/String;[Ljava/lang/String;Z)[Ljava/lang/String;");
const jclass network_helper_class =
env->FindClass("org/dolphinemu/dolphinemu/utils/NetworkHelper");