From a7c05d7e84df5949e8edf42fa6332d6aa58282f6 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 5 Nov 2020 19:47:23 +0100 Subject: Android: Add content provider support to File::FileInfo --- Source/Android/jni/AndroidCommon/IDCache.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp') diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index 674233d79f..5f5503eb87 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -44,6 +44,7 @@ static jmethodID s_compress_cb_run; static jclass s_content_handler_class; static jmethodID s_content_handler_open_fd; static jmethodID s_content_handler_delete; +static jmethodID s_content_handler_get_size_and_is_directory; static jclass s_network_helper_class; static jmethodID s_network_helper_get_network_ip_address; @@ -210,6 +211,11 @@ jmethodID GetContentHandlerDelete() return s_content_handler_delete; } +jmethodID GetContentHandlerGetSizeAndIsDirectory() +{ + return s_content_handler_get_size_and_is_directory; +} + jclass GetNetworkHelperClass() { return s_network_helper_class; @@ -229,6 +235,7 @@ jmethodID GetNetworkHelperGetNetworkGateway() { return s_network_helper_get_network_gateway; } + } // namespace IDCache #ifdef __cplusplus @@ -306,6 +313,8 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) "(Ljava/lang/String;Ljava/lang/String;)I"); s_content_handler_delete = env->GetStaticMethodID(s_content_handler_class, "delete", "(Ljava/lang/String;)Z"); + s_content_handler_get_size_and_is_directory = env->GetStaticMethodID( + s_content_handler_class, "getSizeAndIsDirectory", "(Ljava/lang/String;)J"); const jclass network_helper_class = env->FindClass("org/dolphinemu/dolphinemu/utils/NetworkHelper"); -- cgit v1.2.3 From 525268f043a25116dbb5e362d9e3e84b3f4ca5e5 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 8 Nov 2020 15:39:17 +0100 Subject: Android: Fix opening games with extensionless URI --- Source/Android/jni/AndroidCommon/IDCache.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp') diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index 5f5503eb87..baf44633f7 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -45,6 +45,7 @@ static jclass s_content_handler_class; static jmethodID s_content_handler_open_fd; 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 jclass s_network_helper_class; static jmethodID s_network_helper_get_network_ip_address; @@ -216,6 +217,11 @@ jmethodID GetContentHandlerGetSizeAndIsDirectory() return s_content_handler_get_size_and_is_directory; } +jmethodID GetContentHandlerGetDisplayName() +{ + return s_content_handler_get_display_name; +} + jclass GetNetworkHelperClass() { return s_network_helper_class; @@ -315,6 +321,8 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) env->GetStaticMethodID(s_content_handler_class, "delete", "(Ljava/lang/String;)Z"); s_content_handler_get_size_and_is_directory = env->GetStaticMethodID( s_content_handler_class, "getSizeAndIsDirectory", "(Ljava/lang/String;)J"); + s_content_handler_get_display_name = env->GetStaticMethodID( + s_content_handler_class, "getDisplayName", "(Ljava/lang/String;)Ljava/lang/String;"); const jclass network_helper_class = env->FindClass("org/dolphinemu/dolphinemu/utils/NetworkHelper"); -- cgit v1.2.3 From 2126f62111a95e3a2386467747e5bf94b9943e1d Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 8 Nov 2020 16:57:49 +0100 Subject: Android: Add content provider support to File::ScanDirectoryTree --- Source/Android/jni/AndroidCommon/IDCache.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp') diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index baf44633f7..c79007baae 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -46,6 +46,7 @@ static jmethodID s_content_handler_open_fd; 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 jclass s_network_helper_class; static jmethodID s_network_helper_get_network_ip_address; @@ -222,6 +223,11 @@ jmethodID GetContentHandlerGetDisplayName() return s_content_handler_get_display_name; } +jmethodID GetContentHandlerGetChildNames() +{ + return s_content_handler_get_child_names; +} + jclass GetNetworkHelperClass() { return s_network_helper_class; @@ -323,6 +329,8 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) s_content_handler_class, "getSizeAndIsDirectory", "(Ljava/lang/String;)J"); s_content_handler_get_display_name = env->GetStaticMethodID( 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;)[Ljava/lang/String;"); const jclass network_helper_class = env->FindClass("org/dolphinemu/dolphinemu/utils/NetworkHelper"); -- cgit v1.2.3 From 73855168f3f57f8a3037223235740eb7d9dd76e4 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 8 Nov 2020 23:01:59 +0100 Subject: Android: Show a message when adding a folder with no games To catch people who try to use unsupported formats. --- Source/Android/jni/AndroidCommon/IDCache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp') diff --git a/Source/Android/jni/AndroidCommon/IDCache.cpp b/Source/Android/jni/AndroidCommon/IDCache.cpp index c79007baae..a4a7ef4ebb 100644 --- a/Source/Android/jni/AndroidCommon/IDCache.cpp +++ b/Source/Android/jni/AndroidCommon/IDCache.cpp @@ -330,7 +330,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) s_content_handler_get_display_name = env->GetStaticMethodID( 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;)[Ljava/lang/String;"); + s_content_handler_class, "getChildNames", "(Ljava/lang/String;Z)[Ljava/lang/String;"); const jclass network_helper_class = env->FindClass("org/dolphinemu/dolphinemu/utils/NetworkHelper"); -- cgit v1.2.3 From d78277c063d43e3234fe80a38d272500f3dfce3a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 28 Dec 2020 13:25:24 +0100 Subject: Android: Add specialized content provider implementation of DoFileSearch --- Source/Android/jni/AndroidCommon/IDCache.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Source/Android/jni/AndroidCommon/IDCache.cpp') 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(&env), JNI_VERSION) != JNI_OK) return JNI_ERR; + const jclass string_class = env->FindClass("java/lang/String"); + s_string_class = reinterpret_cast(env->NewGlobalRef(string_class)); + const jclass native_library_class = env->FindClass("org/dolphinemu/dolphinemu/NativeLibrary"); s_native_library_class = reinterpret_cast(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"); -- cgit v1.2.3