From 6f05c400130052cdc92319c4e04c3acfbf9f643f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Thu, 24 Dec 2020 13:34:52 +0100 Subject: [PATCH] Android: Correctly save in-game settings changes to disk --- .../dolphinemu/features/settings/model/NativeConfig.java | 5 +++-- .../dolphinemu/features/settings/model/Settings.java | 2 +- Source/Android/jni/NativeConfig.cpp | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java index edd1c065e4..e82684a1f2 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/NativeConfig.java @@ -3,8 +3,9 @@ package org.dolphinemu.dolphinemu.features.settings.model; public class NativeConfig { public static final int LAYER_BASE_OR_CURRENT = 0; - public static final int LAYER_LOCAL_GAME = 1; - public static final int LAYER_ACTIVE = 2; + public static final int LAYER_BASE = 1; + public static final int LAYER_LOCAL_GAME = 2; + public static final int LAYER_ACTIVE = 3; public static native boolean isSettingSaveable(String file, String section, String key); diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java index 3f3ace3989..1bee31ebf0 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/features/settings/model/Settings.java @@ -200,7 +200,7 @@ public class Settings implements Closeable SettingsFile.saveFile(entry.getKey(), entry.getValue(), view); } - NativeConfig.save(NativeConfig.LAYER_BASE_OR_CURRENT); + NativeConfig.save(NativeConfig.LAYER_BASE); if (!NativeLibrary.IsRunning()) { diff --git a/Source/Android/jni/NativeConfig.cpp b/Source/Android/jni/NativeConfig.cpp index 9de9a16358..14d7d4af3e 100644 --- a/Source/Android/jni/NativeConfig.cpp +++ b/Source/Android/jni/NativeConfig.cpp @@ -14,8 +14,9 @@ #include "jni/AndroidCommon/AndroidCommon.h" constexpr jint LAYER_BASE_OR_CURRENT = 0; -constexpr jint LAYER_LOCAL_GAME = 1; -constexpr jint LAYER_ACTIVE = 2; +constexpr jint LAYER_BASE = 1; +constexpr jint LAYER_LOCAL_GAME = 2; +constexpr jint LAYER_ACTIVE = 3; static Config::Location GetLocation(JNIEnv* env, jstring file, jstring section, jstring key) { @@ -60,6 +61,10 @@ static std::shared_ptr GetLayer(jint layer, const Config::Locatio layer_type = Config::LayerType::CurrentRun; break; + case LAYER_BASE: + layer_type = Config::LayerType::Base; + break; + case LAYER_LOCAL_GAME: layer_type = Config::LayerType::LocalGame; break;