diff options
| -rw-r--r-- | src/android/app/src/main/jni/CMakeLists.txt | 6 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/game_metadata.cpp | 22 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native.cpp | 125 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native.h | 6 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native_config.cpp | 121 | ||||
| -rw-r--r-- | src/android/app/src/main/jni/native_log.cpp | 13 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 8 | ||||
| -rw-r--r-- | src/common/android/android_common.cpp (renamed from src/android/app/src/main/jni/android_common/android_common.cpp) | 23 | ||||
| -rw-r--r-- | src/common/android/android_common.h (renamed from src/android/app/src/main/jni/android_common/android_common.h) | 4 | ||||
| -rw-r--r-- | src/common/android/applets/software_keyboard.cpp (renamed from src/android/app/src/main/jni/applets/software_keyboard.cpp) | 24 | ||||
| -rw-r--r-- | src/common/android/applets/software_keyboard.h (renamed from src/android/app/src/main/jni/applets/software_keyboard.h) | 4 | ||||
| -rw-r--r-- | src/common/android/id_cache.cpp (renamed from src/android/app/src/main/jni/id_cache.cpp) | 12 | ||||
| -rw-r--r-- | src/common/android/id_cache.h (renamed from src/android/app/src/main/jni/id_cache.h) | 26 |
13 files changed, 224 insertions, 170 deletions
diff --git a/src/android/app/src/main/jni/CMakeLists.txt b/src/android/app/src/main/jni/CMakeLists.txt index abc6055ab..20b319c12 100644 --- a/src/android/app/src/main/jni/CMakeLists.txt +++ b/src/android/app/src/main/jni/CMakeLists.txt | |||
| @@ -2,14 +2,8 @@ | |||
| 2 | # SPDX-License-Identifier: GPL-3.0-or-later | 2 | # SPDX-License-Identifier: GPL-3.0-or-later |
| 3 | 3 | ||
| 4 | add_library(yuzu-android SHARED | 4 | add_library(yuzu-android SHARED |
| 5 | android_common/android_common.cpp | ||
| 6 | android_common/android_common.h | ||
| 7 | applets/software_keyboard.cpp | ||
| 8 | applets/software_keyboard.h | ||
| 9 | emu_window/emu_window.cpp | 5 | emu_window/emu_window.cpp |
| 10 | emu_window/emu_window.h | 6 | emu_window/emu_window.h |
| 11 | id_cache.cpp | ||
| 12 | id_cache.h | ||
| 13 | native.cpp | 7 | native.cpp |
| 14 | native.h | 8 | native.h |
| 15 | native_config.cpp | 9 | native_config.cpp |
diff --git a/src/android/app/src/main/jni/game_metadata.cpp b/src/android/app/src/main/jni/game_metadata.cpp index 8f0da1413..c33763b47 100644 --- a/src/android/app/src/main/jni/game_metadata.cpp +++ b/src/android/app/src/main/jni/game_metadata.cpp | |||
| @@ -1,13 +1,12 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "common/android/android_common.h" | ||
| 4 | #include "core/core.h" | 5 | #include "core/core.h" |
| 5 | #include "core/file_sys/fs_filesystem.h" | 6 | #include "core/file_sys/fs_filesystem.h" |
| 6 | #include "core/file_sys/patch_manager.h" | 7 | #include "core/file_sys/patch_manager.h" |
| 7 | #include "core/loader/loader.h" | 8 | #include "core/loader/loader.h" |
| 8 | #include "core/loader/nro.h" | 9 | #include "core/loader/nro.h" |
| 9 | #include "jni.h" | ||
| 10 | #include "jni/android_common/android_common.h" | ||
| 11 | #include "native.h" | 10 | #include "native.h" |
| 12 | 11 | ||
| 13 | struct RomMetadata { | 12 | struct RomMetadata { |
| @@ -79,7 +78,7 @@ extern "C" { | |||
| 79 | jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsValid(JNIEnv* env, jobject obj, | 78 | jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsValid(JNIEnv* env, jobject obj, |
| 80 | jstring jpath) { | 79 | jstring jpath) { |
| 81 | const auto file = EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( | 80 | const auto file = EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( |
| 82 | GetJString(env, jpath), FileSys::OpenMode::Read); | 81 | Common::Android::GetJString(env, jpath), FileSys::OpenMode::Read); |
| 83 | if (!file) { | 82 | if (!file) { |
| 84 | return false; | 83 | return false; |
| 85 | } | 84 | } |
| @@ -104,27 +103,31 @@ jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsValid(JNIEnv* env, jobj | |||
| 104 | 103 | ||
| 105 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getTitle(JNIEnv* env, jobject obj, | 104 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getTitle(JNIEnv* env, jobject obj, |
| 106 | jstring jpath) { | 105 | jstring jpath) { |
| 107 | return ToJString(env, GetRomMetadata(GetJString(env, jpath)).title); | 106 | return Common::Android::ToJString( |
| 107 | env, GetRomMetadata(Common::Android::GetJString(env, jpath)).title); | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getProgramId(JNIEnv* env, jobject obj, | 110 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getProgramId(JNIEnv* env, jobject obj, |
| 111 | jstring jpath) { | 111 | jstring jpath) { |
| 112 | return ToJString(env, std::to_string(GetRomMetadata(GetJString(env, jpath)).programId)); | 112 | return Common::Android::ToJString( |
| 113 | env, std::to_string(GetRomMetadata(Common::Android::GetJString(env, jpath)).programId)); | ||
| 113 | } | 114 | } |
| 114 | 115 | ||
| 115 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getDeveloper(JNIEnv* env, jobject obj, | 116 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getDeveloper(JNIEnv* env, jobject obj, |
| 116 | jstring jpath) { | 117 | jstring jpath) { |
| 117 | return ToJString(env, GetRomMetadata(GetJString(env, jpath)).developer); | 118 | return Common::Android::ToJString( |
| 119 | env, GetRomMetadata(Common::Android::GetJString(env, jpath)).developer); | ||
| 118 | } | 120 | } |
| 119 | 121 | ||
| 120 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getVersion(JNIEnv* env, jobject obj, | 122 | jstring Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getVersion(JNIEnv* env, jobject obj, |
| 121 | jstring jpath, jboolean jreload) { | 123 | jstring jpath, jboolean jreload) { |
| 122 | return ToJString(env, GetRomMetadata(GetJString(env, jpath), jreload).version); | 124 | return Common::Android::ToJString( |
| 125 | env, GetRomMetadata(Common::Android::GetJString(env, jpath), jreload).version); | ||
| 123 | } | 126 | } |
| 124 | 127 | ||
| 125 | jbyteArray Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIcon(JNIEnv* env, jobject obj, | 128 | jbyteArray Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIcon(JNIEnv* env, jobject obj, |
| 126 | jstring jpath) { | 129 | jstring jpath) { |
| 127 | auto icon_data = GetRomMetadata(GetJString(env, jpath)).icon; | 130 | auto icon_data = GetRomMetadata(Common::Android::GetJString(env, jpath)).icon; |
| 128 | jbyteArray icon = env->NewByteArray(static_cast<jsize>(icon_data.size())); | 131 | jbyteArray icon = env->NewByteArray(static_cast<jsize>(icon_data.size())); |
| 129 | env->SetByteArrayRegion(icon, 0, env->GetArrayLength(icon), | 132 | env->SetByteArrayRegion(icon, 0, env->GetArrayLength(icon), |
| 130 | reinterpret_cast<jbyte*>(icon_data.data())); | 133 | reinterpret_cast<jbyte*>(icon_data.data())); |
| @@ -133,7 +136,8 @@ jbyteArray Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIcon(JNIEnv* env, jobje | |||
| 133 | 136 | ||
| 134 | jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsHomebrew(JNIEnv* env, jobject obj, | 137 | jboolean Java_org_yuzu_yuzu_1emu_utils_GameMetadata_getIsHomebrew(JNIEnv* env, jobject obj, |
| 135 | jstring jpath) { | 138 | jstring jpath) { |
| 136 | return static_cast<jboolean>(GetRomMetadata(GetJString(env, jpath)).isHomebrew); | 139 | return static_cast<jboolean>( |
| 140 | GetRomMetadata(Common::Android::GetJString(env, jpath)).isHomebrew); | ||
| 137 | } | 141 | } |
| 138 | 142 | ||
| 139 | void Java_org_yuzu_yuzu_1emu_utils_GameMetadata_resetMetadata(JNIEnv* env, jobject obj) { | 143 | void Java_org_yuzu_yuzu_1emu_utils_GameMetadata_resetMetadata(JNIEnv* env, jobject obj) { |
diff --git a/src/android/app/src/main/jni/native.cpp b/src/android/app/src/main/jni/native.cpp index 654510129..4acc60956 100644 --- a/src/android/app/src/main/jni/native.cpp +++ b/src/android/app/src/main/jni/native.cpp | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #include <frontend_common/content_manager.h> | 20 | #include <frontend_common/content_manager.h> |
| 21 | #include <jni.h> | 21 | #include <jni.h> |
| 22 | 22 | ||
| 23 | #include "common/android/android_common.h" | ||
| 24 | #include "common/android/id_cache.h" | ||
| 23 | #include "common/detached_tasks.h" | 25 | #include "common/detached_tasks.h" |
| 24 | #include "common/dynamic_library.h" | 26 | #include "common/dynamic_library.h" |
| 25 | #include "common/fs/path_util.h" | 27 | #include "common/fs/path_util.h" |
| @@ -57,8 +59,6 @@ | |||
| 57 | #include "hid_core/frontend/emulated_controller.h" | 59 | #include "hid_core/frontend/emulated_controller.h" |
| 58 | #include "hid_core/hid_core.h" | 60 | #include "hid_core/hid_core.h" |
| 59 | #include "hid_core/hid_types.h" | 61 | #include "hid_core/hid_types.h" |
| 60 | #include "jni/android_common/android_common.h" | ||
| 61 | #include "jni/id_cache.h" | ||
| 62 | #include "jni/native.h" | 62 | #include "jni/native.h" |
| 63 | #include "video_core/renderer_base.h" | 63 | #include "video_core/renderer_base.h" |
| 64 | #include "video_core/renderer_vulkan/renderer_vulkan.h" | 64 | #include "video_core/renderer_vulkan/renderer_vulkan.h" |
| @@ -228,7 +228,7 @@ Core::SystemResultStatus EmulationSession::InitializeEmulation(const std::string | |||
| 228 | std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window, m_vulkan_library); | 228 | std::make_unique<EmuWindow_Android>(&m_input_subsystem, m_native_window, m_vulkan_library); |
| 229 | 229 | ||
| 230 | // Initialize system. | 230 | // Initialize system. |
| 231 | jauto android_keyboard = std::make_unique<SoftwareKeyboard::AndroidKeyboard>(); | 231 | jauto android_keyboard = std::make_unique<Common::Android::SoftwareKeyboard::AndroidKeyboard>(); |
| 232 | m_software_keyboard = android_keyboard.get(); | 232 | m_software_keyboard = android_keyboard.get(); |
| 233 | m_system.SetShuttingDown(false); | 233 | m_system.SetShuttingDown(false); |
| 234 | m_system.ApplySettings(); | 234 | m_system.ApplySettings(); |
| @@ -411,37 +411,39 @@ void EmulationSession::OnGamepadDisconnectEvent([[maybe_unused]] int index) { | |||
| 411 | controller->Disconnect(); | 411 | controller->Disconnect(); |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | SoftwareKeyboard::AndroidKeyboard* EmulationSession::SoftwareKeyboard() { | 414 | Common::Android::SoftwareKeyboard::AndroidKeyboard* EmulationSession::SoftwareKeyboard() { |
| 415 | return m_software_keyboard; | 415 | return m_software_keyboard; |
| 416 | } | 416 | } |
| 417 | 417 | ||
| 418 | void EmulationSession::LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, | 418 | void EmulationSession::LoadDiskCacheProgress(VideoCore::LoadCallbackStage stage, int progress, |
| 419 | int max) { | 419 | int max) { |
| 420 | JNIEnv* env = IDCache::GetEnvForThread(); | 420 | JNIEnv* env = Common::Android::GetEnvForThread(); |
| 421 | env->CallStaticVoidMethod(IDCache::GetDiskCacheProgressClass(), | 421 | env->CallStaticVoidMethod(Common::Android::GetDiskCacheProgressClass(), |
| 422 | IDCache::GetDiskCacheLoadProgress(), static_cast<jint>(stage), | 422 | Common::Android::GetDiskCacheLoadProgress(), static_cast<jint>(stage), |
| 423 | static_cast<jint>(progress), static_cast<jint>(max)); | 423 | static_cast<jint>(progress), static_cast<jint>(max)); |
| 424 | } | 424 | } |
| 425 | 425 | ||
| 426 | void EmulationSession::OnEmulationStarted() { | 426 | void EmulationSession::OnEmulationStarted() { |
| 427 | JNIEnv* env = IDCache::GetEnvForThread(); | 427 | JNIEnv* env = Common::Android::GetEnvForThread(); |
| 428 | env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetOnEmulationStarted()); | 428 | env->CallStaticVoidMethod(Common::Android::GetNativeLibraryClass(), |
| 429 | Common::Android::GetOnEmulationStarted()); | ||
| 429 | } | 430 | } |
| 430 | 431 | ||
| 431 | void EmulationSession::OnEmulationStopped(Core::SystemResultStatus result) { | 432 | void EmulationSession::OnEmulationStopped(Core::SystemResultStatus result) { |
| 432 | JNIEnv* env = IDCache::GetEnvForThread(); | 433 | JNIEnv* env = Common::Android::GetEnvForThread(); |
| 433 | env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetOnEmulationStopped(), | 434 | env->CallStaticVoidMethod(Common::Android::GetNativeLibraryClass(), |
| 434 | static_cast<jint>(result)); | 435 | Common::Android::GetOnEmulationStopped(), static_cast<jint>(result)); |
| 435 | } | 436 | } |
| 436 | 437 | ||
| 437 | void EmulationSession::ChangeProgram(std::size_t program_index) { | 438 | void EmulationSession::ChangeProgram(std::size_t program_index) { |
| 438 | JNIEnv* env = IDCache::GetEnvForThread(); | 439 | JNIEnv* env = Common::Android::GetEnvForThread(); |
| 439 | env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), IDCache::GetOnProgramChanged(), | 440 | env->CallStaticVoidMethod(Common::Android::GetNativeLibraryClass(), |
| 441 | Common::Android::GetOnProgramChanged(), | ||
| 440 | static_cast<jint>(program_index)); | 442 | static_cast<jint>(program_index)); |
| 441 | } | 443 | } |
| 442 | 444 | ||
| 443 | u64 EmulationSession::GetProgramId(JNIEnv* env, jstring jprogramId) { | 445 | u64 EmulationSession::GetProgramId(JNIEnv* env, jstring jprogramId) { |
| 444 | auto program_id_string = GetJString(env, jprogramId); | 446 | auto program_id_string = Common::Android::GetJString(env, jprogramId); |
| 445 | try { | 447 | try { |
| 446 | return std::stoull(program_id_string); | 448 | return std::stoull(program_id_string); |
| 447 | } catch (...) { | 449 | } catch (...) { |
| @@ -491,7 +493,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_surfaceDestroyed(JNIEnv* env, jobject | |||
| 491 | 493 | ||
| 492 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, jobject instance, | 494 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setAppDirectory(JNIEnv* env, jobject instance, |
| 493 | [[maybe_unused]] jstring j_directory) { | 495 | [[maybe_unused]] jstring j_directory) { |
| 494 | Common::FS::SetAppDirectory(GetJString(env, j_directory)); | 496 | Common::FS::SetAppDirectory(Common::Android::GetJString(env, j_directory)); |
| 495 | } | 497 | } |
| 496 | 498 | ||
| 497 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, | 499 | int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject instance, |
| @@ -501,21 +503,22 @@ int Java_org_yuzu_yuzu_1emu_NativeLibrary_installFileToNand(JNIEnv* env, jobject | |||
| 501 | jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); | 503 | jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); |
| 502 | const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) { | 504 | const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) { |
| 503 | auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod, | 505 | auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod, |
| 504 | ToJDouble(env, max), ToJDouble(env, progress)); | 506 | Common::Android::ToJDouble(env, max), |
| 505 | return GetJBoolean(env, jwasCancelled); | 507 | Common::Android::ToJDouble(env, progress)); |
| 508 | return Common::Android::GetJBoolean(env, jwasCancelled); | ||
| 506 | }; | 509 | }; |
| 507 | 510 | ||
| 508 | return static_cast<int>( | 511 | return static_cast<int>( |
| 509 | ContentManager::InstallNSP(EmulationSession::GetInstance().System(), | 512 | ContentManager::InstallNSP(EmulationSession::GetInstance().System(), |
| 510 | *EmulationSession::GetInstance().System().GetFilesystem(), | 513 | *EmulationSession::GetInstance().System().GetFilesystem(), |
| 511 | GetJString(env, j_file), callback)); | 514 | Common::Android::GetJString(env, j_file), callback)); |
| 512 | } | 515 | } |
| 513 | 516 | ||
| 514 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_doesUpdateMatchProgram(JNIEnv* env, jobject jobj, | 517 | jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_doesUpdateMatchProgram(JNIEnv* env, jobject jobj, |
| 515 | jstring jprogramId, | 518 | jstring jprogramId, |
| 516 | jstring jupdatePath) { | 519 | jstring jupdatePath) { |
| 517 | u64 program_id = EmulationSession::GetProgramId(env, jprogramId); | 520 | u64 program_id = EmulationSession::GetProgramId(env, jprogramId); |
| 518 | std::string updatePath = GetJString(env, jupdatePath); | 521 | std::string updatePath = Common::Android::GetJString(env, jupdatePath); |
| 519 | std::shared_ptr<FileSys::NSP> nsp = std::make_shared<FileSys::NSP>( | 522 | std::shared_ptr<FileSys::NSP> nsp = std::make_shared<FileSys::NSP>( |
| 520 | EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( | 523 | EmulationSession::GetInstance().System().GetFilesystem()->OpenFile( |
| 521 | updatePath, FileSys::OpenMode::Read)); | 524 | updatePath, FileSys::OpenMode::Read)); |
| @@ -538,8 +541,10 @@ void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_initializeGpuDriver(JNIEnv* e | |||
| 538 | jstring custom_driver_name, | 541 | jstring custom_driver_name, |
| 539 | jstring file_redirect_dir) { | 542 | jstring file_redirect_dir) { |
| 540 | EmulationSession::GetInstance().InitializeGpuDriver( | 543 | EmulationSession::GetInstance().InitializeGpuDriver( |
| 541 | GetJString(env, hook_lib_dir), GetJString(env, custom_driver_dir), | 544 | Common::Android::GetJString(env, hook_lib_dir), |
| 542 | GetJString(env, custom_driver_name), GetJString(env, file_redirect_dir)); | 545 | Common::Android::GetJString(env, custom_driver_dir), |
| 546 | Common::Android::GetJString(env, custom_driver_name), | ||
| 547 | Common::Android::GetJString(env, file_redirect_dir)); | ||
| 543 | } | 548 | } |
| 544 | 549 | ||
| 545 | [[maybe_unused]] static bool CheckKgslPresent() { | 550 | [[maybe_unused]] static bool CheckKgslPresent() { |
| @@ -566,7 +571,7 @@ jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo( | |||
| 566 | JNIEnv* env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) { | 571 | JNIEnv* env, jobject j_obj, jobject j_surf, jstring j_hook_lib_dir) { |
| 567 | const char* file_redirect_dir_{}; | 572 | const char* file_redirect_dir_{}; |
| 568 | int featureFlags{}; | 573 | int featureFlags{}; |
| 569 | std::string hook_lib_dir = GetJString(env, j_hook_lib_dir); | 574 | std::string hook_lib_dir = Common::Android::GetJString(env, j_hook_lib_dir); |
| 570 | auto handle = adrenotools_open_libvulkan(RTLD_NOW, featureFlags, nullptr, hook_lib_dir.c_str(), | 575 | auto handle = adrenotools_open_libvulkan(RTLD_NOW, featureFlags, nullptr, hook_lib_dir.c_str(), |
| 571 | nullptr, nullptr, file_redirect_dir_, nullptr); | 576 | nullptr, nullptr, file_redirect_dir_, nullptr); |
| 572 | auto driver_library = std::make_shared<Common::DynamicLibrary>(handle); | 577 | auto driver_library = std::make_shared<Common::DynamicLibrary>(handle); |
| @@ -587,9 +592,10 @@ jobjectArray Java_org_yuzu_yuzu_1emu_utils_GpuDriverHelper_getSystemDriverInfo( | |||
| 587 | fmt::format("{}.{}.{}", VK_API_VERSION_MAJOR(driver_version), | 592 | fmt::format("{}.{}.{}", VK_API_VERSION_MAJOR(driver_version), |
| 588 | VK_API_VERSION_MINOR(driver_version), VK_API_VERSION_PATCH(driver_version)); | 593 | VK_API_VERSION_MINOR(driver_version), VK_API_VERSION_PATCH(driver_version)); |
| 589 | 594 | ||
| 590 | jobjectArray j_driver_info = | 595 | jobjectArray j_driver_info = env->NewObjectArray( |
| 591 | env->NewObjectArray(2, IDCache::GetStringClass(), ToJString(env, version_string)); | 596 | 2, Common::Android::GetStringClass(), Common::Android::ToJString(env, version_string)); |
| 592 | env->SetObjectArrayElement(j_driver_info, 1, ToJString(env, device.GetDriverName())); | 597 | env->SetObjectArrayElement(j_driver_info, 1, |
| 598 | Common::Android::ToJString(env, device.GetDriverName())); | ||
| 593 | return j_driver_info; | 599 | return j_driver_info; |
| 594 | } | 600 | } |
| 595 | 601 | ||
| @@ -742,15 +748,15 @@ jdoubleArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPerfStats(JNIEnv* env, jcl | |||
| 742 | 748 | ||
| 743 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCpuBackend(JNIEnv* env, jclass clazz) { | 749 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getCpuBackend(JNIEnv* env, jclass clazz) { |
| 744 | if (Settings::IsNceEnabled()) { | 750 | if (Settings::IsNceEnabled()) { |
| 745 | return ToJString(env, "NCE"); | 751 | return Common::Android::ToJString(env, "NCE"); |
| 746 | } | 752 | } |
| 747 | 753 | ||
| 748 | return ToJString(env, "JIT"); | 754 | return Common::Android::ToJString(env, "JIT"); |
| 749 | } | 755 | } |
| 750 | 756 | ||
| 751 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getGpuDriver(JNIEnv* env, jobject jobj) { | 757 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getGpuDriver(JNIEnv* env, jobject jobj) { |
| 752 | return ToJString(env, | 758 | return Common::Android::ToJString( |
| 753 | EmulationSession::GetInstance().System().GPU().Renderer().GetDeviceVendor()); | 759 | env, EmulationSession::GetInstance().System().GPU().Renderer().GetDeviceVendor()); |
| 754 | } | 760 | } |
| 755 | 761 | ||
| 756 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_applySettings(JNIEnv* env, jobject jobj) { | 762 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_applySettings(JNIEnv* env, jobject jobj) { |
| @@ -764,13 +770,14 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_logSettings(JNIEnv* env, jobject jobj | |||
| 764 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_run(JNIEnv* env, jobject jobj, jstring j_path, | 770 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_run(JNIEnv* env, jobject jobj, jstring j_path, |
| 765 | jint j_program_index, | 771 | jint j_program_index, |
| 766 | jboolean j_frontend_initiated) { | 772 | jboolean j_frontend_initiated) { |
| 767 | const std::string path = GetJString(env, j_path); | 773 | const std::string path = Common::Android::GetJString(env, j_path); |
| 768 | 774 | ||
| 769 | const Core::SystemResultStatus result{ | 775 | const Core::SystemResultStatus result{ |
| 770 | RunEmulation(path, j_program_index, j_frontend_initiated)}; | 776 | RunEmulation(path, j_program_index, j_frontend_initiated)}; |
| 771 | if (result != Core::SystemResultStatus::Success) { | 777 | if (result != Core::SystemResultStatus::Success) { |
| 772 | env->CallStaticVoidMethod(IDCache::GetNativeLibraryClass(), | 778 | env->CallStaticVoidMethod(Common::Android::GetNativeLibraryClass(), |
| 773 | IDCache::GetExitEmulationActivity(), static_cast<int>(result)); | 779 | Common::Android::GetExitEmulationActivity(), |
| 780 | static_cast<int>(result)); | ||
| 774 | } | 781 | } |
| 775 | } | 782 | } |
| 776 | 783 | ||
| @@ -781,7 +788,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_logDeviceInfo(JNIEnv* env, jclass cla | |||
| 781 | 788 | ||
| 782 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardText(JNIEnv* env, jclass clazz, | 789 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_submitInlineKeyboardText(JNIEnv* env, jclass clazz, |
| 783 | jstring j_text) { | 790 | jstring j_text) { |
| 784 | const std::u16string input = Common::UTF8ToUTF16(GetJString(env, j_text)); | 791 | const std::u16string input = Common::UTF8ToUTF16(Common::Android::GetJString(env, j_text)); |
| 785 | EmulationSession::GetInstance().SoftwareKeyboard()->SubmitInlineKeyboardText(input); | 792 | EmulationSession::GetInstance().SoftwareKeyboard()->SubmitInlineKeyboardText(input); |
| 786 | } | 793 | } |
| 787 | 794 | ||
| @@ -815,16 +822,16 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getAppletLaunchPath(JNIEnv* env, j | |||
| 815 | auto bis_system = | 822 | auto bis_system = |
| 816 | EmulationSession::GetInstance().System().GetFileSystemController().GetSystemNANDContents(); | 823 | EmulationSession::GetInstance().System().GetFileSystemController().GetSystemNANDContents(); |
| 817 | if (!bis_system) { | 824 | if (!bis_system) { |
| 818 | return ToJString(env, ""); | 825 | return Common::Android::ToJString(env, ""); |
| 819 | } | 826 | } |
| 820 | 827 | ||
| 821 | auto applet_nca = | 828 | auto applet_nca = |
| 822 | bis_system->GetEntry(static_cast<u64>(jid), FileSys::ContentRecordType::Program); | 829 | bis_system->GetEntry(static_cast<u64>(jid), FileSys::ContentRecordType::Program); |
| 823 | if (!applet_nca) { | 830 | if (!applet_nca) { |
| 824 | return ToJString(env, ""); | 831 | return Common::Android::ToJString(env, ""); |
| 825 | } | 832 | } |
| 826 | 833 | ||
| 827 | return ToJString(env, applet_nca->GetFullPath()); | 834 | return Common::Android::ToJString(env, applet_nca->GetFullPath()); |
| 828 | } | 835 | } |
| 829 | 836 | ||
| 830 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setCurrentAppletId(JNIEnv* env, jclass clazz, | 837 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_setCurrentAppletId(JNIEnv* env, jclass clazz, |
| @@ -857,7 +864,7 @@ jboolean Java_org_yuzu_yuzu_1emu_NativeLibrary_isFirmwareAvailable(JNIEnv* env, | |||
| 857 | jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPatchesForFile(JNIEnv* env, jobject jobj, | 864 | jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPatchesForFile(JNIEnv* env, jobject jobj, |
| 858 | jstring jpath, | 865 | jstring jpath, |
| 859 | jstring jprogramId) { | 866 | jstring jprogramId) { |
| 860 | const auto path = GetJString(env, jpath); | 867 | const auto path = Common::Android::GetJString(env, jpath); |
| 861 | const auto vFile = | 868 | const auto vFile = |
| 862 | Core::GetGameFileFromPath(EmulationSession::GetInstance().System().GetFilesystem(), path); | 869 | Core::GetGameFileFromPath(EmulationSession::GetInstance().System().GetFilesystem(), path); |
| 863 | if (vFile == nullptr) { | 870 | if (vFile == nullptr) { |
| @@ -875,14 +882,15 @@ jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_getPatchesForFile(JNIEnv* env | |||
| 875 | 882 | ||
| 876 | auto patches = pm.GetPatches(update_raw); | 883 | auto patches = pm.GetPatches(update_raw); |
| 877 | jobjectArray jpatchArray = | 884 | jobjectArray jpatchArray = |
| 878 | env->NewObjectArray(patches.size(), IDCache::GetPatchClass(), nullptr); | 885 | env->NewObjectArray(patches.size(), Common::Android::GetPatchClass(), nullptr); |
| 879 | int i = 0; | 886 | int i = 0; |
| 880 | for (const auto& patch : patches) { | 887 | for (const auto& patch : patches) { |
| 881 | jobject jpatch = env->NewObject( | 888 | jobject jpatch = env->NewObject( |
| 882 | IDCache::GetPatchClass(), IDCache::GetPatchConstructor(), patch.enabled, | 889 | Common::Android::GetPatchClass(), Common::Android::GetPatchConstructor(), patch.enabled, |
| 883 | ToJString(env, patch.name), ToJString(env, patch.version), | 890 | Common::Android::ToJString(env, patch.name), |
| 884 | static_cast<jint>(patch.type), ToJString(env, std::to_string(patch.program_id)), | 891 | Common::Android::ToJString(env, patch.version), static_cast<jint>(patch.type), |
| 885 | ToJString(env, std::to_string(patch.title_id))); | 892 | Common::Android::ToJString(env, std::to_string(patch.program_id)), |
| 893 | Common::Android::ToJString(env, std::to_string(patch.title_id))); | ||
| 886 | env->SetObjectArrayElement(jpatchArray, i, jpatch); | 894 | env->SetObjectArrayElement(jpatchArray, i, jpatch); |
| 887 | ++i; | 895 | ++i; |
| 888 | } | 896 | } |
| @@ -906,7 +914,7 @@ void Java_org_yuzu_yuzu_1emu_NativeLibrary_removeMod(JNIEnv* env, jobject jobj, | |||
| 906 | jstring jname) { | 914 | jstring jname) { |
| 907 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); | 915 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); |
| 908 | ContentManager::RemoveMod(EmulationSession::GetInstance().System().GetFileSystemController(), | 916 | ContentManager::RemoveMod(EmulationSession::GetInstance().System().GetFileSystemController(), |
| 909 | program_id, GetJString(env, jname)); | 917 | program_id, Common::Android::GetJString(env, jname)); |
| 910 | } | 918 | } |
| 911 | 919 | ||
| 912 | jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_verifyInstalledContents(JNIEnv* env, | 920 | jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_verifyInstalledContents(JNIEnv* env, |
| @@ -917,17 +925,18 @@ jobjectArray Java_org_yuzu_yuzu_1emu_NativeLibrary_verifyInstalledContents(JNIEn | |||
| 917 | jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); | 925 | jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); |
| 918 | const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) { | 926 | const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) { |
| 919 | auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod, | 927 | auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod, |
| 920 | ToJDouble(env, max), ToJDouble(env, progress)); | 928 | Common::Android::ToJDouble(env, max), |
| 921 | return GetJBoolean(env, jwasCancelled); | 929 | Common::Android::ToJDouble(env, progress)); |
| 930 | return Common::Android::GetJBoolean(env, jwasCancelled); | ||
| 922 | }; | 931 | }; |
| 923 | 932 | ||
| 924 | auto& session = EmulationSession::GetInstance(); | 933 | auto& session = EmulationSession::GetInstance(); |
| 925 | std::vector<std::string> result = ContentManager::VerifyInstalledContents( | 934 | std::vector<std::string> result = ContentManager::VerifyInstalledContents( |
| 926 | session.System(), *session.GetContentProvider(), callback); | 935 | session.System(), *session.GetContentProvider(), callback); |
| 927 | jobjectArray jresult = | 936 | jobjectArray jresult = env->NewObjectArray(result.size(), Common::Android::GetStringClass(), |
| 928 | env->NewObjectArray(result.size(), IDCache::GetStringClass(), ToJString(env, "")); | 937 | Common::Android::ToJString(env, "")); |
| 929 | for (size_t i = 0; i < result.size(); ++i) { | 938 | for (size_t i = 0; i < result.size(); ++i) { |
| 930 | env->SetObjectArrayElement(jresult, i, ToJString(env, result[i])); | 939 | env->SetObjectArrayElement(jresult, i, Common::Android::ToJString(env, result[i])); |
| 931 | } | 940 | } |
| 932 | return jresult; | 941 | return jresult; |
| 933 | } | 942 | } |
| @@ -939,19 +948,20 @@ jint Java_org_yuzu_yuzu_1emu_NativeLibrary_verifyGameContents(JNIEnv* env, jobje | |||
| 939 | jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); | 948 | jlambdaClass, "invoke", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); |
| 940 | const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) { | 949 | const auto callback = [env, jcallback, jlambdaInvokeMethod](size_t max, size_t progress) { |
| 941 | auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod, | 950 | auto jwasCancelled = env->CallObjectMethod(jcallback, jlambdaInvokeMethod, |
| 942 | ToJDouble(env, max), ToJDouble(env, progress)); | 951 | Common::Android::ToJDouble(env, max), |
| 943 | return GetJBoolean(env, jwasCancelled); | 952 | Common::Android::ToJDouble(env, progress)); |
| 953 | return Common::Android::GetJBoolean(env, jwasCancelled); | ||
| 944 | }; | 954 | }; |
| 945 | auto& session = EmulationSession::GetInstance(); | 955 | auto& session = EmulationSession::GetInstance(); |
| 946 | return static_cast<jint>( | 956 | return static_cast<jint>(ContentManager::VerifyGameContents( |
| 947 | ContentManager::VerifyGameContents(session.System(), GetJString(env, jpath), callback)); | 957 | session.System(), Common::Android::GetJString(env, jpath), callback)); |
| 948 | } | 958 | } |
| 949 | 959 | ||
| 950 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject jobj, | 960 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject jobj, |
| 951 | jstring jprogramId) { | 961 | jstring jprogramId) { |
| 952 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); | 962 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); |
| 953 | if (program_id == 0) { | 963 | if (program_id == 0) { |
| 954 | return ToJString(env, ""); | 964 | return Common::Android::ToJString(env, ""); |
| 955 | } | 965 | } |
| 956 | 966 | ||
| 957 | auto& system = EmulationSession::GetInstance().System(); | 967 | auto& system = EmulationSession::GetInstance().System(); |
| @@ -968,7 +978,7 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getSavePath(JNIEnv* env, jobject j | |||
| 968 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( | 978 | const auto user_save_data_path = FileSys::SaveDataFactory::GetFullPath( |
| 969 | {}, vfsNandDir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, | 979 | {}, vfsNandDir, FileSys::SaveDataSpaceId::NandUser, FileSys::SaveDataType::SaveData, |
| 970 | program_id, user_id->AsU128(), 0); | 980 | program_id, user_id->AsU128(), 0); |
| 971 | return ToJString(env, user_save_data_path); | 981 | return Common::Android::ToJString(env, user_save_data_path); |
| 972 | } | 982 | } |
| 973 | 983 | ||
| 974 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getDefaultProfileSaveDataRoot(JNIEnv* env, | 984 | jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getDefaultProfileSaveDataRoot(JNIEnv* env, |
| @@ -981,12 +991,13 @@ jstring Java_org_yuzu_yuzu_1emu_NativeLibrary_getDefaultProfileSaveDataRoot(JNIE | |||
| 981 | 991 | ||
| 982 | const auto user_save_data_root = | 992 | const auto user_save_data_root = |
| 983 | FileSys::SaveDataFactory::GetUserGameSaveDataRoot(user_id->AsU128(), jfuture); | 993 | FileSys::SaveDataFactory::GetUserGameSaveDataRoot(user_id->AsU128(), jfuture); |
| 984 | return ToJString(env, user_save_data_root); | 994 | return Common::Android::ToJString(env, user_save_data_root); |
| 985 | } | 995 | } |
| 986 | 996 | ||
| 987 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_addFileToFilesystemProvider(JNIEnv* env, jobject jobj, | 997 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_addFileToFilesystemProvider(JNIEnv* env, jobject jobj, |
| 988 | jstring jpath) { | 998 | jstring jpath) { |
| 989 | EmulationSession::GetInstance().ConfigureFilesystemProvider(GetJString(env, jpath)); | 999 | EmulationSession::GetInstance().ConfigureFilesystemProvider( |
| 1000 | Common::Android::GetJString(env, jpath)); | ||
| 990 | } | 1001 | } |
| 991 | 1002 | ||
| 992 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_clearFilesystemProvider(JNIEnv* env, jobject jobj) { | 1003 | void Java_org_yuzu_yuzu_1emu_NativeLibrary_clearFilesystemProvider(JNIEnv* env, jobject jobj) { |
diff --git a/src/android/app/src/main/jni/native.h b/src/android/app/src/main/jni/native.h index e49d4e015..47936e305 100644 --- a/src/android/app/src/main/jni/native.h +++ b/src/android/app/src/main/jni/native.h | |||
| @@ -2,13 +2,13 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <android/native_window_jni.h> | 4 | #include <android/native_window_jni.h> |
| 5 | #include "common/android/applets/software_keyboard.h" | ||
| 5 | #include "common/detached_tasks.h" | 6 | #include "common/detached_tasks.h" |
| 6 | #include "core/core.h" | 7 | #include "core/core.h" |
| 7 | #include "core/file_sys/registered_cache.h" | 8 | #include "core/file_sys/registered_cache.h" |
| 8 | #include "core/hle/service/acc/profile_manager.h" | 9 | #include "core/hle/service/acc/profile_manager.h" |
| 9 | #include "core/perf_stats.h" | 10 | #include "core/perf_stats.h" |
| 10 | #include "frontend_common/content_manager.h" | 11 | #include "frontend_common/content_manager.h" |
| 11 | #include "jni/applets/software_keyboard.h" | ||
| 12 | #include "jni/emu_window/emu_window.h" | 12 | #include "jni/emu_window/emu_window.h" |
| 13 | #include "video_core/rasterizer_interface.h" | 13 | #include "video_core/rasterizer_interface.h" |
| 14 | 14 | ||
| @@ -54,7 +54,7 @@ public: | |||
| 54 | void SetDeviceType([[maybe_unused]] int index, int type); | 54 | void SetDeviceType([[maybe_unused]] int index, int type); |
| 55 | void OnGamepadConnectEvent([[maybe_unused]] int index); | 55 | void OnGamepadConnectEvent([[maybe_unused]] int index); |
| 56 | void OnGamepadDisconnectEvent([[maybe_unused]] int index); | 56 | void OnGamepadDisconnectEvent([[maybe_unused]] int index); |
| 57 | SoftwareKeyboard::AndroidKeyboard* SoftwareKeyboard(); | 57 | Common::Android::SoftwareKeyboard::AndroidKeyboard* SoftwareKeyboard(); |
| 58 | 58 | ||
| 59 | static void OnEmulationStarted(); | 59 | static void OnEmulationStarted(); |
| 60 | 60 | ||
| @@ -79,7 +79,7 @@ private: | |||
| 79 | Core::SystemResultStatus m_load_result{Core::SystemResultStatus::ErrorNotInitialized}; | 79 | Core::SystemResultStatus m_load_result{Core::SystemResultStatus::ErrorNotInitialized}; |
| 80 | std::atomic<bool> m_is_running = false; | 80 | std::atomic<bool> m_is_running = false; |
| 81 | std::atomic<bool> m_is_paused = false; | 81 | std::atomic<bool> m_is_paused = false; |
| 82 | SoftwareKeyboard::AndroidKeyboard* m_software_keyboard{}; | 82 | Common::Android::SoftwareKeyboard::AndroidKeyboard* m_software_keyboard{}; |
| 83 | std::unique_ptr<FileSys::ManualContentProvider> m_manual_provider; | 83 | std::unique_ptr<FileSys::ManualContentProvider> m_manual_provider; |
| 84 | int m_applet_id{1}; | 84 | int m_applet_id{1}; |
| 85 | 85 | ||
diff --git a/src/android/app/src/main/jni/native_config.cpp b/src/android/app/src/main/jni/native_config.cpp index c6c3343dc..8ae10fbc7 100644 --- a/src/android/app/src/main/jni/native_config.cpp +++ b/src/android/app/src/main/jni/native_config.cpp | |||
| @@ -8,11 +8,11 @@ | |||
| 8 | 8 | ||
| 9 | #include "android_config.h" | 9 | #include "android_config.h" |
| 10 | #include "android_settings.h" | 10 | #include "android_settings.h" |
| 11 | #include "common/android/android_common.h" | ||
| 12 | #include "common/android/id_cache.h" | ||
| 11 | #include "common/logging/log.h" | 13 | #include "common/logging/log.h" |
| 12 | #include "common/settings.h" | 14 | #include "common/settings.h" |
| 13 | #include "frontend_common/config.h" | 15 | #include "frontend_common/config.h" |
| 14 | #include "jni/android_common/android_common.h" | ||
| 15 | #include "jni/id_cache.h" | ||
| 16 | #include "native.h" | 16 | #include "native.h" |
| 17 | 17 | ||
| 18 | std::unique_ptr<AndroidConfig> global_config; | 18 | std::unique_ptr<AndroidConfig> global_config; |
| @@ -20,7 +20,7 @@ std::unique_ptr<AndroidConfig> per_game_config; | |||
| 20 | 20 | ||
| 21 | template <typename T> | 21 | template <typename T> |
| 22 | Settings::Setting<T>* getSetting(JNIEnv* env, jstring jkey) { | 22 | Settings::Setting<T>* getSetting(JNIEnv* env, jstring jkey) { |
| 23 | auto key = GetJString(env, jkey); | 23 | auto key = Common::Android::GetJString(env, jkey); |
| 24 | auto basic_setting = Settings::values.linkage.by_key[key]; | 24 | auto basic_setting = Settings::values.linkage.by_key[key]; |
| 25 | if (basic_setting != 0) { | 25 | if (basic_setting != 0) { |
| 26 | return static_cast<Settings::Setting<T>*>(basic_setting); | 26 | return static_cast<Settings::Setting<T>*>(basic_setting); |
| @@ -55,7 +55,7 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_initializePerGameConfig(JNIEnv* | |||
| 55 | jstring jprogramId, | 55 | jstring jprogramId, |
| 56 | jstring jfileName) { | 56 | jstring jfileName) { |
| 57 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); | 57 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); |
| 58 | auto file_name = GetJString(env, jfileName); | 58 | auto file_name = Common::Android::GetJString(env, jfileName); |
| 59 | const auto config_file_name = program_id == 0 ? file_name : fmt::format("{:016X}", program_id); | 59 | const auto config_file_name = program_id == 0 ? file_name : fmt::format("{:016X}", program_id); |
| 60 | per_game_config = | 60 | per_game_config = |
| 61 | std::make_unique<AndroidConfig>(config_file_name, Config::ConfigType::PerGameConfig); | 61 | std::make_unique<AndroidConfig>(config_file_name, Config::ConfigType::PerGameConfig); |
| @@ -186,9 +186,9 @@ jstring Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getString(JNIEnv* env, jobjec | |||
| 186 | jboolean needGlobal) { | 186 | jboolean needGlobal) { |
| 187 | auto setting = getSetting<std::string>(env, jkey); | 187 | auto setting = getSetting<std::string>(env, jkey); |
| 188 | if (setting == nullptr) { | 188 | if (setting == nullptr) { |
| 189 | return ToJString(env, ""); | 189 | return Common::Android::ToJString(env, ""); |
| 190 | } | 190 | } |
| 191 | return ToJString(env, setting->GetValue(static_cast<bool>(needGlobal))); | 191 | return Common::Android::ToJString(env, setting->GetValue(static_cast<bool>(needGlobal))); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setString(JNIEnv* env, jobject obj, jstring jkey, | 194 | void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setString(JNIEnv* env, jobject obj, jstring jkey, |
| @@ -198,7 +198,7 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setString(JNIEnv* env, jobject o | |||
| 198 | return; | 198 | return; |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | setting->SetValue(GetJString(env, value)); | 201 | setting->SetValue(Common::Android::GetJString(env, value)); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getIsRuntimeModifiable(JNIEnv* env, jobject obj, | 204 | jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getIsRuntimeModifiable(JNIEnv* env, jobject obj, |
| @@ -214,13 +214,13 @@ jstring Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getPairedSettingKey(JNIEnv* e | |||
| 214 | jstring jkey) { | 214 | jstring jkey) { |
| 215 | auto setting = getSetting<std::string>(env, jkey); | 215 | auto setting = getSetting<std::string>(env, jkey); |
| 216 | if (setting == nullptr) { | 216 | if (setting == nullptr) { |
| 217 | return ToJString(env, ""); | 217 | return Common::Android::ToJString(env, ""); |
| 218 | } | 218 | } |
| 219 | if (setting->PairedSetting() == nullptr) { | 219 | if (setting->PairedSetting() == nullptr) { |
| 220 | return ToJString(env, ""); | 220 | return Common::Android::ToJString(env, ""); |
| 221 | } | 221 | } |
| 222 | 222 | ||
| 223 | return ToJString(env, setting->PairedSetting()->GetLabel()); | 223 | return Common::Android::ToJString(env, setting->PairedSetting()->GetLabel()); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getIsSwitchable(JNIEnv* env, jobject obj, | 226 | jboolean Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getIsSwitchable(JNIEnv* env, jobject obj, |
| @@ -262,21 +262,21 @@ jstring Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getDefaultToString(JNIEnv* en | |||
| 262 | jstring jkey) { | 262 | jstring jkey) { |
| 263 | auto setting = getSetting<std::string>(env, jkey); | 263 | auto setting = getSetting<std::string>(env, jkey); |
| 264 | if (setting != nullptr) { | 264 | if (setting != nullptr) { |
| 265 | return ToJString(env, setting->DefaultToString()); | 265 | return Common::Android::ToJString(env, setting->DefaultToString()); |
| 266 | } | 266 | } |
| 267 | return ToJString(env, ""); | 267 | return Common::Android::ToJString(env, ""); |
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | jobjectArray Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getGameDirs(JNIEnv* env, jobject obj) { | 270 | jobjectArray Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getGameDirs(JNIEnv* env, jobject obj) { |
| 271 | jclass gameDirClass = IDCache::GetGameDirClass(); | 271 | jclass gameDirClass = Common::Android::GetGameDirClass(); |
| 272 | jmethodID gameDirConstructor = IDCache::GetGameDirConstructor(); | 272 | jmethodID gameDirConstructor = Common::Android::GetGameDirConstructor(); |
| 273 | jobjectArray jgameDirArray = | 273 | jobjectArray jgameDirArray = |
| 274 | env->NewObjectArray(AndroidSettings::values.game_dirs.size(), gameDirClass, nullptr); | 274 | env->NewObjectArray(AndroidSettings::values.game_dirs.size(), gameDirClass, nullptr); |
| 275 | for (size_t i = 0; i < AndroidSettings::values.game_dirs.size(); ++i) { | 275 | for (size_t i = 0; i < AndroidSettings::values.game_dirs.size(); ++i) { |
| 276 | jobject jgameDir = | 276 | jobject jgameDir = env->NewObject( |
| 277 | env->NewObject(gameDirClass, gameDirConstructor, | 277 | gameDirClass, gameDirConstructor, |
| 278 | ToJString(env, AndroidSettings::values.game_dirs[i].path), | 278 | Common::Android::ToJString(env, AndroidSettings::values.game_dirs[i].path), |
| 279 | static_cast<jboolean>(AndroidSettings::values.game_dirs[i].deep_scan)); | 279 | static_cast<jboolean>(AndroidSettings::values.game_dirs[i].deep_scan)); |
| 280 | env->SetObjectArrayElement(jgameDirArray, i, jgameDir); | 280 | env->SetObjectArrayElement(jgameDirArray, i, jgameDir); |
| 281 | } | 281 | } |
| 282 | return jgameDirArray; | 282 | return jgameDirArray; |
| @@ -292,14 +292,14 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setGameDirs(JNIEnv* env, jobject | |||
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | jobject dir = env->GetObjectArrayElement(gameDirs, 0); | 294 | jobject dir = env->GetObjectArrayElement(gameDirs, 0); |
| 295 | jclass gameDirClass = IDCache::GetGameDirClass(); | 295 | jclass gameDirClass = Common::Android::GetGameDirClass(); |
| 296 | jfieldID uriStringField = env->GetFieldID(gameDirClass, "uriString", "Ljava/lang/String;"); | 296 | jfieldID uriStringField = env->GetFieldID(gameDirClass, "uriString", "Ljava/lang/String;"); |
| 297 | jfieldID deepScanBooleanField = env->GetFieldID(gameDirClass, "deepScan", "Z"); | 297 | jfieldID deepScanBooleanField = env->GetFieldID(gameDirClass, "deepScan", "Z"); |
| 298 | for (int i = 0; i < size; ++i) { | 298 | for (int i = 0; i < size; ++i) { |
| 299 | dir = env->GetObjectArrayElement(gameDirs, i); | 299 | dir = env->GetObjectArrayElement(gameDirs, i); |
| 300 | jstring juriString = static_cast<jstring>(env->GetObjectField(dir, uriStringField)); | 300 | jstring juriString = static_cast<jstring>(env->GetObjectField(dir, uriStringField)); |
| 301 | jboolean jdeepScanBoolean = env->GetBooleanField(dir, deepScanBooleanField); | 301 | jboolean jdeepScanBoolean = env->GetBooleanField(dir, deepScanBooleanField); |
| 302 | std::string uriString = GetJString(env, juriString); | 302 | std::string uriString = Common::Android::GetJString(env, juriString); |
| 303 | AndroidSettings::values.game_dirs.push_back( | 303 | AndroidSettings::values.game_dirs.push_back( |
| 304 | AndroidSettings::GameDir{uriString, static_cast<bool>(jdeepScanBoolean)}); | 304 | AndroidSettings::GameDir{uriString, static_cast<bool>(jdeepScanBoolean)}); |
| 305 | } | 305 | } |
| @@ -307,13 +307,13 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setGameDirs(JNIEnv* env, jobject | |||
| 307 | 307 | ||
| 308 | void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_addGameDir(JNIEnv* env, jobject obj, | 308 | void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_addGameDir(JNIEnv* env, jobject obj, |
| 309 | jobject gameDir) { | 309 | jobject gameDir) { |
| 310 | jclass gameDirClass = IDCache::GetGameDirClass(); | 310 | jclass gameDirClass = Common::Android::GetGameDirClass(); |
| 311 | jfieldID uriStringField = env->GetFieldID(gameDirClass, "uriString", "Ljava/lang/String;"); | 311 | jfieldID uriStringField = env->GetFieldID(gameDirClass, "uriString", "Ljava/lang/String;"); |
| 312 | jfieldID deepScanBooleanField = env->GetFieldID(gameDirClass, "deepScan", "Z"); | 312 | jfieldID deepScanBooleanField = env->GetFieldID(gameDirClass, "deepScan", "Z"); |
| 313 | 313 | ||
| 314 | jstring juriString = static_cast<jstring>(env->GetObjectField(gameDir, uriStringField)); | 314 | jstring juriString = static_cast<jstring>(env->GetObjectField(gameDir, uriStringField)); |
| 315 | jboolean jdeepScanBoolean = env->GetBooleanField(gameDir, deepScanBooleanField); | 315 | jboolean jdeepScanBoolean = env->GetBooleanField(gameDir, deepScanBooleanField); |
| 316 | std::string uriString = GetJString(env, juriString); | 316 | std::string uriString = Common::Android::GetJString(env, juriString); |
| 317 | AndroidSettings::values.game_dirs.push_back( | 317 | AndroidSettings::values.game_dirs.push_back( |
| 318 | AndroidSettings::GameDir{uriString, static_cast<bool>(jdeepScanBoolean)}); | 318 | AndroidSettings::GameDir{uriString, static_cast<bool>(jdeepScanBoolean)}); |
| 319 | } | 319 | } |
| @@ -323,9 +323,11 @@ jobjectArray Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getDisabledAddons(JNIEnv | |||
| 323 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); | 323 | auto program_id = EmulationSession::GetProgramId(env, jprogramId); |
| 324 | auto& disabledAddons = Settings::values.disabled_addons[program_id]; | 324 | auto& disabledAddons = Settings::values.disabled_addons[program_id]; |
| 325 | jobjectArray jdisabledAddonsArray = | 325 | jobjectArray jdisabledAddonsArray = |
| 326 | env->NewObjectArray(disabledAddons.size(), IDCache::GetStringClass(), ToJString(env, "")); | 326 | env->NewObjectArray(disabledAddons.size(), Common::Android::GetStringClass(), |
| 327 | Common::Android::ToJString(env, "")); | ||
| 327 | for (size_t i = 0; i < disabledAddons.size(); ++i) { | 328 | for (size_t i = 0; i < disabledAddons.size(); ++i) { |
| 328 | env->SetObjectArrayElement(jdisabledAddonsArray, i, ToJString(env, disabledAddons[i])); | 329 | env->SetObjectArrayElement(jdisabledAddonsArray, i, |
| 330 | Common::Android::ToJString(env, disabledAddons[i])); | ||
| 329 | } | 331 | } |
| 330 | return jdisabledAddonsArray; | 332 | return jdisabledAddonsArray; |
| 331 | } | 333 | } |
| @@ -339,7 +341,7 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setDisabledAddons(JNIEnv* env, j | |||
| 339 | const int size = env->GetArrayLength(jdisabledAddons); | 341 | const int size = env->GetArrayLength(jdisabledAddons); |
| 340 | for (int i = 0; i < size; ++i) { | 342 | for (int i = 0; i < size; ++i) { |
| 341 | auto jaddon = static_cast<jstring>(env->GetObjectArrayElement(jdisabledAddons, i)); | 343 | auto jaddon = static_cast<jstring>(env->GetObjectArrayElement(jdisabledAddons, i)); |
| 342 | disabled_addons.push_back(GetJString(env, jaddon)); | 344 | disabled_addons.push_back(Common::Android::GetJString(env, jaddon)); |
| 343 | } | 345 | } |
| 344 | Settings::values.disabled_addons[program_id] = disabled_addons; | 346 | Settings::values.disabled_addons[program_id] = disabled_addons; |
| 345 | } | 347 | } |
| @@ -348,26 +350,27 @@ jobjectArray Java_org_yuzu_yuzu_1emu_utils_NativeConfig_getOverlayControlData(JN | |||
| 348 | jobject obj) { | 350 | jobject obj) { |
| 349 | jobjectArray joverlayControlDataArray = | 351 | jobjectArray joverlayControlDataArray = |
| 350 | env->NewObjectArray(AndroidSettings::values.overlay_control_data.size(), | 352 | env->NewObjectArray(AndroidSettings::values.overlay_control_data.size(), |
| 351 | IDCache::GetOverlayControlDataClass(), nullptr); | 353 | Common::Android::GetOverlayControlDataClass(), nullptr); |
| 352 | for (size_t i = 0; i < AndroidSettings::values.overlay_control_data.size(); ++i) { | 354 | for (size_t i = 0; i < AndroidSettings::values.overlay_control_data.size(); ++i) { |
| 353 | const auto& control_data = AndroidSettings::values.overlay_control_data[i]; | 355 | const auto& control_data = AndroidSettings::values.overlay_control_data[i]; |
| 354 | jobject jlandscapePosition = | 356 | jobject jlandscapePosition = |
| 355 | env->NewObject(IDCache::GetPairClass(), IDCache::GetPairConstructor(), | 357 | env->NewObject(Common::Android::GetPairClass(), Common::Android::GetPairConstructor(), |
| 356 | ToJDouble(env, control_data.landscape_position.first), | 358 | Common::Android::ToJDouble(env, control_data.landscape_position.first), |
| 357 | ToJDouble(env, control_data.landscape_position.second)); | 359 | Common::Android::ToJDouble(env, control_data.landscape_position.second)); |
| 358 | jobject jportraitPosition = | 360 | jobject jportraitPosition = |
| 359 | env->NewObject(IDCache::GetPairClass(), IDCache::GetPairConstructor(), | 361 | env->NewObject(Common::Android::GetPairClass(), Common::Android::GetPairConstructor(), |
| 360 | ToJDouble(env, control_data.portrait_position.first), | 362 | Common::Android::ToJDouble(env, control_data.portrait_position.first), |
| 361 | ToJDouble(env, control_data.portrait_position.second)); | 363 | Common::Android::ToJDouble(env, control_data.portrait_position.second)); |
| 362 | jobject jfoldablePosition = | 364 | jobject jfoldablePosition = |
| 363 | env->NewObject(IDCache::GetPairClass(), IDCache::GetPairConstructor(), | 365 | env->NewObject(Common::Android::GetPairClass(), Common::Android::GetPairConstructor(), |
| 364 | ToJDouble(env, control_data.foldable_position.first), | 366 | Common::Android::ToJDouble(env, control_data.foldable_position.first), |
| 365 | ToJDouble(env, control_data.foldable_position.second)); | 367 | Common::Android::ToJDouble(env, control_data.foldable_position.second)); |
| 366 | 368 | ||
| 367 | jobject jcontrolData = env->NewObject( | 369 | jobject jcontrolData = |
| 368 | IDCache::GetOverlayControlDataClass(), IDCache::GetOverlayControlDataConstructor(), | 370 | env->NewObject(Common::Android::GetOverlayControlDataClass(), |
| 369 | ToJString(env, control_data.id), control_data.enabled, jlandscapePosition, | 371 | Common::Android::GetOverlayControlDataConstructor(), |
| 370 | jportraitPosition, jfoldablePosition); | 372 | Common::Android::ToJString(env, control_data.id), control_data.enabled, |
| 373 | jlandscapePosition, jportraitPosition, jfoldablePosition); | ||
| 371 | env->SetObjectArrayElement(joverlayControlDataArray, i, jcontrolData); | 374 | env->SetObjectArrayElement(joverlayControlDataArray, i, jcontrolData); |
| 372 | } | 375 | } |
| 373 | return joverlayControlDataArray; | 376 | return joverlayControlDataArray; |
| @@ -384,33 +387,41 @@ void Java_org_yuzu_yuzu_1emu_utils_NativeConfig_setOverlayControlData( | |||
| 384 | 387 | ||
| 385 | for (int i = 0; i < size; ++i) { | 388 | for (int i = 0; i < size; ++i) { |
| 386 | jobject joverlayControlData = env->GetObjectArrayElement(joverlayControlDataArray, i); | 389 | jobject joverlayControlData = env->GetObjectArrayElement(joverlayControlDataArray, i); |
| 387 | jstring jidString = static_cast<jstring>( | 390 | jstring jidString = static_cast<jstring>(env->GetObjectField( |
| 388 | env->GetObjectField(joverlayControlData, IDCache::GetOverlayControlDataIdField())); | 391 | joverlayControlData, Common::Android::GetOverlayControlDataIdField())); |
| 389 | bool enabled = static_cast<bool>(env->GetBooleanField( | 392 | bool enabled = static_cast<bool>(env->GetBooleanField( |
| 390 | joverlayControlData, IDCache::GetOverlayControlDataEnabledField())); | 393 | joverlayControlData, Common::Android::GetOverlayControlDataEnabledField())); |
| 391 | 394 | ||
| 392 | jobject jlandscapePosition = env->GetObjectField( | 395 | jobject jlandscapePosition = env->GetObjectField( |
| 393 | joverlayControlData, IDCache::GetOverlayControlDataLandscapePositionField()); | 396 | joverlayControlData, Common::Android::GetOverlayControlDataLandscapePositionField()); |
| 394 | std::pair<double, double> landscape_position = std::make_pair( | 397 | std::pair<double, double> landscape_position = std::make_pair( |
| 395 | GetJDouble(env, env->GetObjectField(jlandscapePosition, IDCache::GetPairFirstField())), | 398 | Common::Android::GetJDouble( |
| 396 | GetJDouble(env, | 399 | env, env->GetObjectField(jlandscapePosition, Common::Android::GetPairFirstField())), |
| 397 | env->GetObjectField(jlandscapePosition, IDCache::GetPairSecondField()))); | 400 | Common::Android::GetJDouble( |
| 401 | env, | ||
| 402 | env->GetObjectField(jlandscapePosition, Common::Android::GetPairSecondField()))); | ||
| 398 | 403 | ||
| 399 | jobject jportraitPosition = env->GetObjectField( | 404 | jobject jportraitPosition = env->GetObjectField( |
| 400 | joverlayControlData, IDCache::GetOverlayControlDataPortraitPositionField()); | 405 | joverlayControlData, Common::Android::GetOverlayControlDataPortraitPositionField()); |
| 401 | std::pair<double, double> portrait_position = std::make_pair( | 406 | std::pair<double, double> portrait_position = std::make_pair( |
| 402 | GetJDouble(env, env->GetObjectField(jportraitPosition, IDCache::GetPairFirstField())), | 407 | Common::Android::GetJDouble( |
| 403 | GetJDouble(env, env->GetObjectField(jportraitPosition, IDCache::GetPairSecondField()))); | 408 | env, env->GetObjectField(jportraitPosition, Common::Android::GetPairFirstField())), |
| 409 | Common::Android::GetJDouble( | ||
| 410 | env, | ||
| 411 | env->GetObjectField(jportraitPosition, Common::Android::GetPairSecondField()))); | ||
| 404 | 412 | ||
| 405 | jobject jfoldablePosition = env->GetObjectField( | 413 | jobject jfoldablePosition = env->GetObjectField( |
| 406 | joverlayControlData, IDCache::GetOverlayControlDataFoldablePositionField()); | 414 | joverlayControlData, Common::Android::GetOverlayControlDataFoldablePositionField()); |
| 407 | std::pair<double, double> foldable_position = std::make_pair( | 415 | std::pair<double, double> foldable_position = std::make_pair( |
| 408 | GetJDouble(env, env->GetObjectField(jfoldablePosition, IDCache::GetPairFirstField())), | 416 | Common::Android::GetJDouble( |
| 409 | GetJDouble(env, env->GetObjectField(jfoldablePosition, IDCache::GetPairSecondField()))); | 417 | env, env->GetObjectField(jfoldablePosition, Common::Android::GetPairFirstField())), |
| 418 | Common::Android::GetJDouble( | ||
| 419 | env, | ||
| 420 | env->GetObjectField(jfoldablePosition, Common::Android::GetPairSecondField()))); | ||
| 410 | 421 | ||
| 411 | AndroidSettings::values.overlay_control_data.push_back(AndroidSettings::OverlayControlData{ | 422 | AndroidSettings::values.overlay_control_data.push_back(AndroidSettings::OverlayControlData{ |
| 412 | GetJString(env, jidString), enabled, landscape_position, portrait_position, | 423 | Common::Android::GetJString(env, jidString), enabled, landscape_position, |
| 413 | foldable_position}); | 424 | portrait_position, foldable_position}); |
| 414 | } | 425 | } |
| 415 | } | 426 | } |
| 416 | 427 | ||
diff --git a/src/android/app/src/main/jni/native_log.cpp b/src/android/app/src/main/jni/native_log.cpp index 33d691dc8..95dd1f057 100644 --- a/src/android/app/src/main/jni/native_log.cpp +++ b/src/android/app/src/main/jni/native_log.cpp | |||
| @@ -1,31 +1,30 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <common/android/android_common.h> | ||
| 4 | #include <common/logging/log.h> | 5 | #include <common/logging/log.h> |
| 5 | #include <jni.h> | 6 | #include <jni.h> |
| 6 | 7 | ||
| 7 | #include "android_common/android_common.h" | ||
| 8 | |||
| 9 | extern "C" { | 8 | extern "C" { |
| 10 | 9 | ||
| 11 | void Java_org_yuzu_yuzu_1emu_utils_Log_debug(JNIEnv* env, jobject obj, jstring jmessage) { | 10 | void Java_org_yuzu_yuzu_1emu_utils_Log_debug(JNIEnv* env, jobject obj, jstring jmessage) { |
| 12 | LOG_DEBUG(Frontend, "{}", GetJString(env, jmessage)); | 11 | LOG_DEBUG(Frontend, "{}", Common::Android::GetJString(env, jmessage)); |
| 13 | } | 12 | } |
| 14 | 13 | ||
| 15 | void Java_org_yuzu_yuzu_1emu_utils_Log_warning(JNIEnv* env, jobject obj, jstring jmessage) { | 14 | void Java_org_yuzu_yuzu_1emu_utils_Log_warning(JNIEnv* env, jobject obj, jstring jmessage) { |
| 16 | LOG_WARNING(Frontend, "{}", GetJString(env, jmessage)); | 15 | LOG_WARNING(Frontend, "{}", Common::Android::GetJString(env, jmessage)); |
| 17 | } | 16 | } |
| 18 | 17 | ||
| 19 | void Java_org_yuzu_yuzu_1emu_utils_Log_info(JNIEnv* env, jobject obj, jstring jmessage) { | 18 | void Java_org_yuzu_yuzu_1emu_utils_Log_info(JNIEnv* env, jobject obj, jstring jmessage) { |
| 20 | LOG_INFO(Frontend, "{}", GetJString(env, jmessage)); | 19 | LOG_INFO(Frontend, "{}", Common::Android::GetJString(env, jmessage)); |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | void Java_org_yuzu_yuzu_1emu_utils_Log_error(JNIEnv* env, jobject obj, jstring jmessage) { | 22 | void Java_org_yuzu_yuzu_1emu_utils_Log_error(JNIEnv* env, jobject obj, jstring jmessage) { |
| 24 | LOG_ERROR(Frontend, "{}", GetJString(env, jmessage)); | 23 | LOG_ERROR(Frontend, "{}", Common::Android::GetJString(env, jmessage)); |
| 25 | } | 24 | } |
| 26 | 25 | ||
| 27 | void Java_org_yuzu_yuzu_1emu_utils_Log_critical(JNIEnv* env, jobject obj, jstring jmessage) { | 26 | void Java_org_yuzu_yuzu_1emu_utils_Log_critical(JNIEnv* env, jobject obj, jstring jmessage) { |
| 28 | LOG_CRITICAL(Frontend, "{}", GetJString(env, jmessage)); | 27 | LOG_CRITICAL(Frontend, "{}", Common::Android::GetJString(env, jmessage)); |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | } // extern "C" | 30 | } // extern "C" |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 85926fc8f..8ff1326f2 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -179,9 +179,15 @@ endif() | |||
| 179 | 179 | ||
| 180 | if(ANDROID) | 180 | if(ANDROID) |
| 181 | target_sources(common | 181 | target_sources(common |
| 182 | PRIVATE | 182 | PUBLIC |
| 183 | fs/fs_android.cpp | 183 | fs/fs_android.cpp |
| 184 | fs/fs_android.h | 184 | fs/fs_android.h |
| 185 | android/android_common.cpp | ||
| 186 | android/android_common.h | ||
| 187 | android/id_cache.cpp | ||
| 188 | android/id_cache.h | ||
| 189 | android/applets/software_keyboard.cpp | ||
| 190 | android/applets/software_keyboard.h | ||
| 185 | ) | 191 | ) |
| 186 | endif() | 192 | endif() |
| 187 | 193 | ||
diff --git a/src/android/app/src/main/jni/android_common/android_common.cpp b/src/common/android/android_common.cpp index 7018a52af..e79005658 100644 --- a/src/android/app/src/main/jni/android_common/android_common.cpp +++ b/src/common/android/android_common.cpp | |||
| @@ -1,15 +1,17 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "jni/android_common/android_common.h" | 4 | #include "android_common.h" |
| 5 | 5 | ||
| 6 | #include <string> | 6 | #include <string> |
| 7 | #include <string_view> | 7 | #include <string_view> |
| 8 | 8 | ||
| 9 | #include <jni.h> | 9 | #include <jni.h> |
| 10 | 10 | ||
| 11 | #include "common/android/id_cache.h" | ||
| 11 | #include "common/string_util.h" | 12 | #include "common/string_util.h" |
| 12 | #include "jni/id_cache.h" | 13 | |
| 14 | namespace Common::Android { | ||
| 13 | 15 | ||
| 14 | std::string GetJString(JNIEnv* env, jstring jstr) { | 16 | std::string GetJString(JNIEnv* env, jstring jstr) { |
| 15 | if (!jstr) { | 17 | if (!jstr) { |
| @@ -18,7 +20,8 @@ std::string GetJString(JNIEnv* env, jstring jstr) { | |||
| 18 | 20 | ||
| 19 | const jchar* jchars = env->GetStringChars(jstr, nullptr); | 21 | const jchar* jchars = env->GetStringChars(jstr, nullptr); |
| 20 | const jsize length = env->GetStringLength(jstr); | 22 | const jsize length = env->GetStringLength(jstr); |
| 21 | const std::u16string_view string_view(reinterpret_cast<const char16_t*>(jchars), length); | 23 | const std::u16string_view string_view(reinterpret_cast<const char16_t*>(jchars), |
| 24 | static_cast<u32>(length)); | ||
| 22 | const std::string converted_string = Common::UTF16ToUTF8(string_view); | 25 | const std::string converted_string = Common::UTF16ToUTF8(string_view); |
| 23 | env->ReleaseStringChars(jstr, jchars); | 26 | env->ReleaseStringChars(jstr, jchars); |
| 24 | 27 | ||
| @@ -36,25 +39,27 @@ jstring ToJString(JNIEnv* env, std::u16string_view str) { | |||
| 36 | } | 39 | } |
| 37 | 40 | ||
| 38 | double GetJDouble(JNIEnv* env, jobject jdouble) { | 41 | double GetJDouble(JNIEnv* env, jobject jdouble) { |
| 39 | return env->GetDoubleField(jdouble, IDCache::GetDoubleValueField()); | 42 | return env->GetDoubleField(jdouble, GetDoubleValueField()); |
| 40 | } | 43 | } |
| 41 | 44 | ||
| 42 | jobject ToJDouble(JNIEnv* env, double value) { | 45 | jobject ToJDouble(JNIEnv* env, double value) { |
| 43 | return env->NewObject(IDCache::GetDoubleClass(), IDCache::GetDoubleConstructor(), value); | 46 | return env->NewObject(GetDoubleClass(), GetDoubleConstructor(), value); |
| 44 | } | 47 | } |
| 45 | 48 | ||
| 46 | s32 GetJInteger(JNIEnv* env, jobject jinteger) { | 49 | s32 GetJInteger(JNIEnv* env, jobject jinteger) { |
| 47 | return env->GetIntField(jinteger, IDCache::GetIntegerValueField()); | 50 | return env->GetIntField(jinteger, GetIntegerValueField()); |
| 48 | } | 51 | } |
| 49 | 52 | ||
| 50 | jobject ToJInteger(JNIEnv* env, s32 value) { | 53 | jobject ToJInteger(JNIEnv* env, s32 value) { |
| 51 | return env->NewObject(IDCache::GetIntegerClass(), IDCache::GetIntegerConstructor(), value); | 54 | return env->NewObject(GetIntegerClass(), GetIntegerConstructor(), value); |
| 52 | } | 55 | } |
| 53 | 56 | ||
| 54 | bool GetJBoolean(JNIEnv* env, jobject jboolean) { | 57 | bool GetJBoolean(JNIEnv* env, jobject jboolean) { |
| 55 | return env->GetBooleanField(jboolean, IDCache::GetBooleanValueField()); | 58 | return env->GetBooleanField(jboolean, GetBooleanValueField()); |
| 56 | } | 59 | } |
| 57 | 60 | ||
| 58 | jobject ToJBoolean(JNIEnv* env, bool value) { | 61 | jobject ToJBoolean(JNIEnv* env, bool value) { |
| 59 | return env->NewObject(IDCache::GetBooleanClass(), IDCache::GetBooleanConstructor(), value); | 62 | return env->NewObject(GetBooleanClass(), GetBooleanConstructor(), value); |
| 60 | } | 63 | } |
| 64 | |||
| 65 | } // namespace Common::Android | ||
diff --git a/src/android/app/src/main/jni/android_common/android_common.h b/src/common/android/android_common.h index 29a338c0a..d0ccb4ec2 100644 --- a/src/android/app/src/main/jni/android_common/android_common.h +++ b/src/common/android/android_common.h | |||
| @@ -8,6 +8,8 @@ | |||
| 8 | #include <jni.h> | 8 | #include <jni.h> |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace Common::Android { | ||
| 12 | |||
| 11 | std::string GetJString(JNIEnv* env, jstring jstr); | 13 | std::string GetJString(JNIEnv* env, jstring jstr); |
| 12 | jstring ToJString(JNIEnv* env, std::string_view str); | 14 | jstring ToJString(JNIEnv* env, std::string_view str); |
| 13 | jstring ToJString(JNIEnv* env, std::u16string_view str); | 15 | jstring ToJString(JNIEnv* env, std::u16string_view str); |
| @@ -20,3 +22,5 @@ jobject ToJInteger(JNIEnv* env, s32 value); | |||
| 20 | 22 | ||
| 21 | bool GetJBoolean(JNIEnv* env, jobject jboolean); | 23 | bool GetJBoolean(JNIEnv* env, jobject jboolean); |
| 22 | jobject ToJBoolean(JNIEnv* env, bool value); | 24 | jobject ToJBoolean(JNIEnv* env, bool value); |
| 25 | |||
| 26 | } // namespace Common::Android | ||
diff --git a/src/android/app/src/main/jni/applets/software_keyboard.cpp b/src/common/android/applets/software_keyboard.cpp index 9943483e8..477e62b16 100644 --- a/src/android/app/src/main/jni/applets/software_keyboard.cpp +++ b/src/common/android/applets/software_keyboard.cpp | |||
| @@ -6,12 +6,12 @@ | |||
| 6 | 6 | ||
| 7 | #include <jni.h> | 7 | #include <jni.h> |
| 8 | 8 | ||
| 9 | #include "common/android/android_common.h" | ||
| 10 | #include "common/android/applets/software_keyboard.h" | ||
| 11 | #include "common/android/id_cache.h" | ||
| 9 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 10 | #include "common/string_util.h" | 13 | #include "common/string_util.h" |
| 11 | #include "core/core.h" | 14 | #include "core/core.h" |
| 12 | #include "jni/android_common/android_common.h" | ||
| 13 | #include "jni/applets/software_keyboard.h" | ||
| 14 | #include "jni/id_cache.h" | ||
| 15 | 15 | ||
| 16 | static jclass s_software_keyboard_class; | 16 | static jclass s_software_keyboard_class; |
| 17 | static jclass s_keyboard_config_class; | 17 | static jclass s_keyboard_config_class; |
| @@ -19,10 +19,10 @@ static jclass s_keyboard_data_class; | |||
| 19 | static jmethodID s_swkbd_execute_normal; | 19 | static jmethodID s_swkbd_execute_normal; |
| 20 | static jmethodID s_swkbd_execute_inline; | 20 | static jmethodID s_swkbd_execute_inline; |
| 21 | 21 | ||
| 22 | namespace SoftwareKeyboard { | 22 | namespace Common::Android::SoftwareKeyboard { |
| 23 | 23 | ||
| 24 | static jobject ToJKeyboardParams(const Core::Frontend::KeyboardInitializeParameters& config) { | 24 | static jobject ToJKeyboardParams(const Core::Frontend::KeyboardInitializeParameters& config) { |
| 25 | JNIEnv* env = IDCache::GetEnvForThread(); | 25 | JNIEnv* env = GetEnvForThread(); |
| 26 | jobject object = env->AllocObject(s_keyboard_config_class); | 26 | jobject object = env->AllocObject(s_keyboard_config_class); |
| 27 | 27 | ||
| 28 | env->SetObjectField(object, | 28 | env->SetObjectField(object, |
| @@ -78,7 +78,7 @@ static jobject ToJKeyboardParams(const Core::Frontend::KeyboardInitializeParamet | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | AndroidKeyboard::ResultData AndroidKeyboard::ResultData::CreateFromFrontend(jobject object) { | 80 | AndroidKeyboard::ResultData AndroidKeyboard::ResultData::CreateFromFrontend(jobject object) { |
| 81 | JNIEnv* env = IDCache::GetEnvForThread(); | 81 | JNIEnv* env = GetEnvForThread(); |
| 82 | const jstring string = reinterpret_cast<jstring>(env->GetObjectField( | 82 | const jstring string = reinterpret_cast<jstring>(env->GetObjectField( |
| 83 | object, env->GetFieldID(s_keyboard_data_class, "text", "Ljava/lang/String;"))); | 83 | object, env->GetFieldID(s_keyboard_data_class, "text", "Ljava/lang/String;"))); |
| 84 | return ResultData{GetJString(env, string), | 84 | return ResultData{GetJString(env, string), |
| @@ -141,7 +141,7 @@ void AndroidKeyboard::ShowNormalKeyboard() const { | |||
| 141 | 141 | ||
| 142 | // Pivot to a new thread, as we cannot call GetEnvForThread() from a Fiber. | 142 | // Pivot to a new thread, as we cannot call GetEnvForThread() from a Fiber. |
| 143 | std::thread([&] { | 143 | std::thread([&] { |
| 144 | data = ResultData::CreateFromFrontend(IDCache::GetEnvForThread()->CallStaticObjectMethod( | 144 | data = ResultData::CreateFromFrontend(GetEnvForThread()->CallStaticObjectMethod( |
| 145 | s_software_keyboard_class, s_swkbd_execute_normal, ToJKeyboardParams(parameters))); | 145 | s_software_keyboard_class, s_swkbd_execute_normal, ToJKeyboardParams(parameters))); |
| 146 | }).join(); | 146 | }).join(); |
| 147 | 147 | ||
| @@ -183,8 +183,8 @@ void AndroidKeyboard::ShowInlineKeyboard( | |||
| 183 | // Pivot to a new thread, as we cannot call GetEnvForThread() from a Fiber. | 183 | // Pivot to a new thread, as we cannot call GetEnvForThread() from a Fiber. |
| 184 | m_is_inline_active = true; | 184 | m_is_inline_active = true; |
| 185 | std::thread([&] { | 185 | std::thread([&] { |
| 186 | IDCache::GetEnvForThread()->CallStaticVoidMethod( | 186 | GetEnvForThread()->CallStaticVoidMethod(s_software_keyboard_class, s_swkbd_execute_inline, |
| 187 | s_software_keyboard_class, s_swkbd_execute_inline, ToJKeyboardParams(parameters)); | 187 | ToJKeyboardParams(parameters)); |
| 188 | }).join(); | 188 | }).join(); |
| 189 | } | 189 | } |
| 190 | 190 | ||
| @@ -220,7 +220,7 @@ void AndroidKeyboard::SubmitInlineKeyboardText(std::u16string submitted_text) { | |||
| 220 | m_current_text += submitted_text; | 220 | m_current_text += submitted_text; |
| 221 | 221 | ||
| 222 | submit_inline_callback(Service::AM::Frontend::SwkbdReplyType::ChangedString, m_current_text, | 222 | submit_inline_callback(Service::AM::Frontend::SwkbdReplyType::ChangedString, m_current_text, |
| 223 | m_current_text.size()); | 223 | static_cast<int>(m_current_text.size())); |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | void AndroidKeyboard::SubmitInlineKeyboardInput(int key_code) { | 226 | void AndroidKeyboard::SubmitInlineKeyboardInput(int key_code) { |
| @@ -242,7 +242,7 @@ void AndroidKeyboard::SubmitInlineKeyboardInput(int key_code) { | |||
| 242 | case KEYCODE_DEL: | 242 | case KEYCODE_DEL: |
| 243 | m_current_text.pop_back(); | 243 | m_current_text.pop_back(); |
| 244 | submit_inline_callback(Service::AM::Frontend::SwkbdReplyType::ChangedString, m_current_text, | 244 | submit_inline_callback(Service::AM::Frontend::SwkbdReplyType::ChangedString, m_current_text, |
| 245 | m_current_text.size()); | 245 | static_cast<int>(m_current_text.size())); |
| 246 | break; | 246 | break; |
| 247 | } | 247 | } |
| 248 | } | 248 | } |
| @@ -274,4 +274,4 @@ void CleanupJNI(JNIEnv* env) { | |||
| 274 | env->DeleteGlobalRef(s_keyboard_data_class); | 274 | env->DeleteGlobalRef(s_keyboard_data_class); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | } // namespace SoftwareKeyboard | 277 | } // namespace Common::Android::SoftwareKeyboard |
diff --git a/src/android/app/src/main/jni/applets/software_keyboard.h b/src/common/android/applets/software_keyboard.h index 2affc01f6..9fd09d27c 100644 --- a/src/android/app/src/main/jni/applets/software_keyboard.h +++ b/src/common/android/applets/software_keyboard.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include "core/frontend/applets/software_keyboard.h" | 8 | #include "core/frontend/applets/software_keyboard.h" |
| 9 | 9 | ||
| 10 | namespace SoftwareKeyboard { | 10 | namespace Common::Android::SoftwareKeyboard { |
| 11 | 11 | ||
| 12 | class AndroidKeyboard final : public Core::Frontend::SoftwareKeyboardApplet { | 12 | class AndroidKeyboard final : public Core::Frontend::SoftwareKeyboardApplet { |
| 13 | public: | 13 | public: |
| @@ -66,7 +66,7 @@ void InitJNI(JNIEnv* env); | |||
| 66 | // Should be called in JNI_Unload | 66 | // Should be called in JNI_Unload |
| 67 | void CleanupJNI(JNIEnv* env); | 67 | void CleanupJNI(JNIEnv* env); |
| 68 | 68 | ||
| 69 | } // namespace SoftwareKeyboard | 69 | } // namespace Common::Android::SoftwareKeyboard |
| 70 | 70 | ||
| 71 | // Native function calls | 71 | // Native function calls |
| 72 | extern "C" { | 72 | extern "C" { |
diff --git a/src/android/app/src/main/jni/id_cache.cpp b/src/common/android/id_cache.cpp index f30100bd8..f39262db9 100644 --- a/src/android/app/src/main/jni/id_cache.cpp +++ b/src/common/android/id_cache.cpp | |||
| @@ -3,10 +3,10 @@ | |||
| 3 | 3 | ||
| 4 | #include <jni.h> | 4 | #include <jni.h> |
| 5 | 5 | ||
| 6 | #include "applets/software_keyboard.h" | ||
| 7 | #include "common/android/id_cache.h" | ||
| 6 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 7 | #include "common/fs/fs_android.h" | 9 | #include "common/fs/fs_android.h" |
| 8 | #include "jni/applets/software_keyboard.h" | ||
| 9 | #include "jni/id_cache.h" | ||
| 10 | #include "video_core/rasterizer_interface.h" | 10 | #include "video_core/rasterizer_interface.h" |
| 11 | 11 | ||
| 12 | static JavaVM* s_java_vm; | 12 | static JavaVM* s_java_vm; |
| @@ -67,7 +67,7 @@ static jfieldID s_boolean_value_field; | |||
| 67 | 67 | ||
| 68 | static constexpr jint JNI_VERSION = JNI_VERSION_1_6; | 68 | static constexpr jint JNI_VERSION = JNI_VERSION_1_6; |
| 69 | 69 | ||
| 70 | namespace IDCache { | 70 | namespace Common::Android { |
| 71 | 71 | ||
| 72 | JNIEnv* GetEnvForThread() { | 72 | JNIEnv* GetEnvForThread() { |
| 73 | thread_local static struct OwnedEnv { | 73 | thread_local static struct OwnedEnv { |
| @@ -276,8 +276,6 @@ jfieldID GetBooleanValueField() { | |||
| 276 | return s_boolean_value_field; | 276 | return s_boolean_value_field; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | } // namespace IDCache | ||
| 280 | |||
| 281 | #ifdef __cplusplus | 279 | #ifdef __cplusplus |
| 282 | extern "C" { | 280 | extern "C" { |
| 283 | #endif | 281 | #endif |
| @@ -393,7 +391,7 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) { | |||
| 393 | Common::FS::Android::RegisterCallbacks(env, s_native_library_class); | 391 | Common::FS::Android::RegisterCallbacks(env, s_native_library_class); |
| 394 | 392 | ||
| 395 | // Initialize applets | 393 | // Initialize applets |
| 396 | SoftwareKeyboard::InitJNI(env); | 394 | Common::Android::SoftwareKeyboard::InitJNI(env); |
| 397 | 395 | ||
| 398 | return JNI_VERSION; | 396 | return JNI_VERSION; |
| 399 | } | 397 | } |
| @@ -426,3 +424,5 @@ void JNI_OnUnload(JavaVM* vm, void* reserved) { | |||
| 426 | #ifdef __cplusplus | 424 | #ifdef __cplusplus |
| 427 | } | 425 | } |
| 428 | #endif | 426 | #endif |
| 427 | |||
| 428 | } // namespace Common::Android | ||
diff --git a/src/android/app/src/main/jni/id_cache.h b/src/common/android/id_cache.h index 00e48afc0..47802f96c 100644 --- a/src/android/app/src/main/jni/id_cache.h +++ b/src/common/android/id_cache.h | |||
| @@ -3,20 +3,40 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <future> | ||
| 6 | #include <jni.h> | 7 | #include <jni.h> |
| 7 | 8 | ||
| 8 | #include "video_core/rasterizer_interface.h" | 9 | #include "video_core/rasterizer_interface.h" |
| 9 | 10 | ||
| 10 | namespace IDCache { | 11 | namespace Common::Android { |
| 11 | 12 | ||
| 12 | JNIEnv* GetEnvForThread(); | 13 | JNIEnv* GetEnvForThread(); |
| 14 | |||
| 15 | /** | ||
| 16 | * Starts a new thread to run JNI. Intended to be used when you must run JNI from a fiber. | ||
| 17 | * @tparam T Typename of the return value for the work param | ||
| 18 | * @param work Lambda that runs JNI code. This function will take care of attaching this thread to | ||
| 19 | * the JVM | ||
| 20 | * @return The result from the work lambda param | ||
| 21 | */ | ||
| 22 | template <typename T = void> | ||
| 23 | T RunJNIOnFiber(const std::function<T(JNIEnv*)>& work) { | ||
| 24 | std::future<T> j_result = std::async(std::launch::async, [&] { | ||
| 25 | auto env = GetEnvForThread(); | ||
| 26 | return work(env); | ||
| 27 | }); | ||
| 28 | return j_result.get(); | ||
| 29 | } | ||
| 30 | |||
| 13 | jclass GetNativeLibraryClass(); | 31 | jclass GetNativeLibraryClass(); |
| 32 | |||
| 14 | jclass GetDiskCacheProgressClass(); | 33 | jclass GetDiskCacheProgressClass(); |
| 15 | jclass GetDiskCacheLoadCallbackStageClass(); | 34 | jclass GetDiskCacheLoadCallbackStageClass(); |
| 16 | jclass GetGameDirClass(); | 35 | jclass GetGameDirClass(); |
| 17 | jmethodID GetGameDirConstructor(); | 36 | jmethodID GetGameDirConstructor(); |
| 18 | jmethodID GetExitEmulationActivity(); | ||
| 19 | jmethodID GetDiskCacheLoadProgress(); | 37 | jmethodID GetDiskCacheLoadProgress(); |
| 38 | |||
| 39 | jmethodID GetExitEmulationActivity(); | ||
| 20 | jmethodID GetOnEmulationStarted(); | 40 | jmethodID GetOnEmulationStarted(); |
| 21 | jmethodID GetOnEmulationStopped(); | 41 | jmethodID GetOnEmulationStopped(); |
| 22 | jmethodID GetOnProgramChanged(); | 42 | jmethodID GetOnProgramChanged(); |
| @@ -65,4 +85,4 @@ jclass GetBooleanClass(); | |||
| 65 | jmethodID GetBooleanConstructor(); | 85 | jmethodID GetBooleanConstructor(); |
| 66 | jfieldID GetBooleanValueField(); | 86 | jfieldID GetBooleanValueField(); |
| 67 | 87 | ||
| 68 | } // namespace IDCache | 88 | } // namespace Common::Android |