Default the DroidDeck HUD to FPS and 1% low (#3660)

Keep 0.1% and 0.01% lows opt-in without changing saved choices.
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-12-03 20:51:53 -05:00
1 parent 54e1dcb5a4
commit b81d7d796f
3 files changed
+24 -4

No files matched your search

@@ -11,7 +11,7 @@ internal object DroidDeckHudConfig {
"showPerCore" to "1", "showTemp" to "1", "showBatteryTemp" to "1", "showGpuTemp" to "0",
"showVram" to "1", "showRAM" to "1", "showSwap" to "1", "showBattery" to "0", "showBatteryTime" to "0", "showPower" to "1",
"showFPS" to "1", "showFPSGraph" to "1", "fpsDecimal" to "1",
"showLatency" to "1", "showAvg" to "1", "showLow1" to "1", "showLow01" to "1", "showLow001" to "1",
"showLatency" to "1", "showAvg" to "1", "showLow1" to "1", "showLow01" to "0", "showLow001" to "0",
"showEngine" to "1", "showRenderer" to "1",
"showDisplay" to "1", "showHdr" to "1", "showNet" to "1", "showResolution" to "1",
"showProton" to "1", "showSession" to "1", "showClock" to "1", "hudOrder" to "",
@@ -92,8 +92,8 @@ class DroidDeckHudView(context: Context) : View(context) {
private var showBatteryTemp = false
private var showGraph = false
private var showLow1 = true
private var showLow01 = true
private var showLow001 = true
private var showLow01 = false
private var showLow001 = false
private var fpsDecimal = true
private var showClockTime = true
private var showLatency = true
@@ -204,6 +204,24 @@ class DroidDeckHudPanelTest {
assertEquals(ramFirst.toString(), listOf("RAM", "FPS", "PWR"), ramFirst.map { it.take(3) })
}
@Test fun optionalLowsCanBeSavedAndResetToOff() {
val app = RuntimeEnvironment.getApplication()
val defaults = DroidDeckHudConfig.load(app)
assertEquals("1", defaults["showFPS"])
assertEquals("1", defaults["showLow1"])
assertEquals("0", defaults["showLow01"])
assertEquals("0", defaults["showLow001"])
val switches = mapOf("showLow01" to true, "showLow001" to true)
DroidDeckHudConfig.choose(app, switches, emptyList())
val saved = DroidDeckHudConfig.load(app)
for (key in switches.keys) assertEquals("1", saved[key])
DroidDeckHudConfig.reset(app)
val reset = DroidDeckHudConfig.load(app)
for (key in switches.keys) assertEquals("0", reset[key])
}
@Test fun aSaveKeepsTheLegacyOrderForTheOtherSizes() {
val app = RuntimeEnvironment.getApplication()
SessionPrefs.setDroidDeckHudConfig(app, "hudSize=strip,hudOrder=showRAM|showFPS")
@@ -251,7 +269,9 @@ class DroidDeckHudPanelTest {
val lines = view.linesForTest()
assertEquals(lines.toString(), 1, lines.size)
val line = lines.single()
listOf("DXVK", "fps", "GPU", "CPU", "RAM", "BAT 79%").forEach { assertTrue(line, it in line) }
listOf("DXVK", "fps", "1%", "GPU", "CPU", "RAM", "BAT 79%").forEach { assertTrue(line, it in line) }
assertFalse(line, "0.1%" in line)
assertFalse(line, "0.01%" in line)
assertTrue(line, line.indexOf("DXVK") < line.indexOf("GPU") && line.indexOf("GPU") < line.indexOf("BAT"))
val bitmap = Bitmap.createBitmap(view.measuredWidth, view.measuredHeight, Bitmap.Config.ARGB_8888)