From 9b4f1b1b14b85159c8b9122eaee01ca57670af2e Mon Sep 17 00:00:00 2001 From: DHD2280 Date: Fri, 29 Nov 2024 01:49:07 +0100 Subject: [PATCH] More Logging enabled by default in nightly Signed-off-by: DHD2280 --- .../it/dhd/oxygencustomizer/utils/PreferenceHelper.java | 9 +++++++++ .../main/java/it/dhd/oxygencustomizer/xposed/XPrefs.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java b/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java index 3fc0bed61..f019228cd 100644 --- a/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java +++ b/app/src/main/java/it/dhd/oxygencustomizer/utils/PreferenceHelper.java @@ -169,6 +169,8 @@ import java.util.List; import it.dhd.oneplusui.preference.OplusSliderPreference; +import it.dhd.oneplusui.preference.OplusSwitchPreference; +import it.dhd.oxygencustomizer.BuildConfig; import it.dhd.oxygencustomizer.R; import it.dhd.oxygencustomizer.xposed.utils.ExtendedSharedPreferences; @@ -894,6 +896,8 @@ public static boolean isEnabled(String key) { instance.mPreferences.getBoolean("fix_lag_switch", false) && !instance.mPreferences.getBoolean("fix_lag_force_all_apps", false); + case "moreLogging" -> !BuildConfig.VERSION_NAME.contains("nightly"); + default -> true; }; } @@ -1169,6 +1173,11 @@ public static void setupPreference(Preference preference) { // Quick Settings case "QSLabelScaleFactor", "QSSecondaryLabelScaleFactor" -> ((OplusSliderPreference) preference).slider.setLabelFormatter(value -> (value + 100) + "%"); + case "moreLogging" -> { + if (BuildConfig.VERSION_NAME.contains("nightly")) { + ((OplusSwitchPreference) preference).setChecked(true); + } + } } } catch (Throwable ignored) { } diff --git a/app/src/main/java/it/dhd/oxygencustomizer/xposed/XPrefs.java b/app/src/main/java/it/dhd/oxygencustomizer/xposed/XPrefs.java index d39c9abe3..09a588ee4 100644 --- a/app/src/main/java/it/dhd/oxygencustomizer/xposed/XPrefs.java +++ b/app/src/main/java/it/dhd/oxygencustomizer/xposed/XPrefs.java @@ -31,7 +31,7 @@ public static void loadEverything(String packageName, String... key) { boolean moreLogging = Xprefs.getBoolean(Constants.Preferences.General.PREF_MORE_LOGGING, false); for (XposedMods thisMod : XPLauncher.runningMods) { - thisMod.mDebug = moreLogging; + thisMod.mDebug = BuildConfig.VERSION_NAME.contains("nightly") || moreLogging; thisMod.updatePrefs(key); } }