Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9052 from Ebola16/GCAT
Android: Better GCAdapter scanning thread management
  • Loading branch information
lioncash committed Sep 1, 2020
2 parents 42a7c95 + 9fe6466 commit d17c407
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Expand Up @@ -376,6 +376,8 @@ public static native String GetConfig(String configFile, String Section, String

public static native void ReloadConfig();

public static native void UpdateGCAdapterScanThread();

/**
* Initializes the native parts of the app.
*
Expand Down
Expand Up @@ -232,6 +232,7 @@ public void saveSettings(SettingsActivityView view, Context context, Set<String>
NativeLibrary.ReloadConfig();
NativeLibrary.ReloadWiimoteConfig();
NativeLibrary.ReloadLoggerConfig();
NativeLibrary.UpdateGCAdapterScanThread();

if (modifiedSettings.contains(SettingsFile.KEY_RECURSIVE_ISO_PATHS))
{
Expand Down
14 changes: 14 additions & 0 deletions Source/Android/jni/MainAndroid.cpp
Expand Up @@ -50,6 +50,7 @@

#include "InputCommon/ControllerInterface/Android/Android.h"
#include "InputCommon/ControllerInterface/Touch/ButtonManager.h"
#include "InputCommon/GCAdapter.h"

#include "UICommon/UICommon.h"

Expand Down Expand Up @@ -630,6 +631,19 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_ReloadConfig
SConfig::GetInstance().LoadSettings();
}

JNIEXPORT void JNICALL
Java_org_dolphinemu_dolphinemu_NativeLibrary_UpdateGCAdapterScanThread(JNIEnv* env, jobject obj)
{
if (GCAdapter::UseAdapter())
{
GCAdapter::StartScanThread();
}
else
{
GCAdapter::StopScanThread();
}
}

JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_Initialize(JNIEnv* env,
jobject obj)
{
Expand Down

0 comments on commit d17c407

Please sign in to comment.