experimental clear display patch

This commit is contained in:
lbux 2026-03-01 15:24:11 -08:00
parent 6c2b836aa8
commit 84a73e730f
3 changed files with 94 additions and 31 deletions

View file

@ -4,10 +4,22 @@ import app.revanced.extension.tiktok.settings.Settings;
@SuppressWarnings("unused")
public class RememberClearDisplayPatch {
private static Boolean cachedState = null;
public static boolean getClearDisplayState() {
return Settings.CLEAR_DISPLAY.get();
if (cachedState == null) {
cachedState = Settings.CLEAR_DISPLAY.get();
}
return cachedState;
}
public static void rememberClearDisplayState(boolean newState) {
if (cachedState != null && cachedState == newState) {
return;
}
cachedState = newState;
Settings.CLEAR_DISPLAY.save(newState);
}
}
}