mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge pull request #13605 from JosJuice/android-cinit-native
Android: Don't call NativeLibrary methods during class init
This commit is contained in:
@ -1961,7 +1961,7 @@ class SettingsFragmentPresenter(
|
|||||||
IntSetting.LOGGER_VERBOSITY,
|
IntSetting.LOGGER_VERBOSITY,
|
||||||
R.string.log_verbosity,
|
R.string.log_verbosity,
|
||||||
0,
|
0,
|
||||||
logVerbosityEntries, logVerbosityValues
|
getLogVerbosityEntries(), getLogVerbosityValues()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
sl.add(
|
sl.add(
|
||||||
@ -1993,7 +1993,7 @@ class SettingsFragmentPresenter(
|
|||||||
) { SettingsAdapter.clearLog() })
|
) { SettingsAdapter.clearLog() })
|
||||||
|
|
||||||
sl.add(HeaderSetting(context, R.string.log_types, 0))
|
sl.add(HeaderSetting(context, R.string.log_types, 0))
|
||||||
for (logType in LOG_TYPE_NAMES) {
|
for (logType in NativeLibrary.GetLogTypeNames()) {
|
||||||
sl.add(LogSwitchSetting(logType.first, logType.second, ""))
|
sl.add(LogSwitchSetting(logType.first, logType.second, ""))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2543,7 +2543,7 @@ class SettingsFragmentPresenter(
|
|||||||
fun setAllLogTypes(value: Boolean) {
|
fun setAllLogTypes(value: Boolean) {
|
||||||
val settings = fragmentView.settings
|
val settings = fragmentView.settings
|
||||||
|
|
||||||
for (logType in LOG_TYPE_NAMES) {
|
for (logType in NativeLibrary.GetLogTypeNames()) {
|
||||||
AdHocBooleanSetting(
|
AdHocBooleanSetting(
|
||||||
Settings.FILE_LOGGER,
|
Settings.FILE_LOGGER,
|
||||||
Settings.SECTION_LOGGER_LOGS,
|
Settings.SECTION_LOGGER_LOGS,
|
||||||
@ -2604,26 +2604,29 @@ class SettingsFragmentPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val LOG_TYPE_NAMES = NativeLibrary.GetLogTypeNames()
|
|
||||||
const val ARG_CONTROLLER_TYPE = "controller_type"
|
const val ARG_CONTROLLER_TYPE = "controller_type"
|
||||||
const val ARG_SERIALPORT1_TYPE = "serialport1_type"
|
const val ARG_SERIALPORT1_TYPE = "serialport1_type"
|
||||||
|
|
||||||
// Value obtained from LogLevel in Common/Logging/Log.h
|
// Value obtained from LogLevel in Common/Logging/Log.h
|
||||||
private val logVerbosityEntries: Int
|
private fun getLogVerbosityEntries(): Int {
|
||||||
get() =
|
// GetMaxLogLevel is effectively a constant, but we can't call it before loading
|
||||||
if (NativeLibrary.GetMaxLogLevel() == 5) {
|
// the native library
|
||||||
R.array.logVerbosityEntriesMaxLevelDebug
|
return if (NativeLibrary.GetMaxLogLevel() == 5) {
|
||||||
} else {
|
R.array.logVerbosityEntriesMaxLevelDebug
|
||||||
R.array.logVerbosityEntriesMaxLevelInfo
|
} else {
|
||||||
}
|
R.array.logVerbosityEntriesMaxLevelInfo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Value obtained from LogLevel in Common/Logging/Log.h
|
// Value obtained from LogLevel in Common/Logging/Log.h
|
||||||
private val logVerbosityValues: Int
|
private fun getLogVerbosityValues(): Int {
|
||||||
get() =
|
// GetMaxLogLevel is effectively a constant, but we can't call it before loading
|
||||||
if (NativeLibrary.GetMaxLogLevel() == 5) {
|
// the native library
|
||||||
R.array.logVerbosityValuesMaxLevelDebug
|
return if (NativeLibrary.GetMaxLogLevel() == 5) {
|
||||||
} else {
|
R.array.logVerbosityValuesMaxLevelDebug
|
||||||
R.array.logVerbosityValuesMaxLevelInfo
|
} else {
|
||||||
}
|
R.array.logVerbosityValuesMaxLevelInfo
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user