fix(android): show flavor channel in about

This commit is contained in:
joshavant
2026-06-05 06:38:20 -05:00
parent 9413a5aba5
commit e4583b4f57
2 changed files with 22 additions and 1 deletions

View File

@@ -971,7 +971,7 @@ private fun AboutSettingsScreen(
listOf(
SettingsMetric("Android App", BuildConfig.VERSION_NAME),
SettingsMetric("Build", BuildConfig.VERSION_CODE.toString()),
SettingsMetric("Channel", "Play"),
SettingsMetric("Channel", androidDistributionChannel()),
SettingsMetric("Gateway", currentGatewayVersion ?: "Not connected"),
),
)
@@ -994,6 +994,14 @@ private fun AboutSettingsScreen(
}
}
internal fun androidDistributionChannel(flavor: String = BuildConfig.FLAVOR): String =
when (flavor.trim()) {
"play" -> "Play"
"thirdParty" -> "Third-party"
"" -> "Unknown"
else -> flavor.trim()
}
@Composable
private fun AboutStatusRow(
title: String,

View File

@@ -0,0 +1,13 @@
package ai.openclaw.app.ui
import org.junit.Assert.assertEquals
import org.junit.Test
class SettingsScreensTest {
@Test
fun androidDistributionChannelUsesBuildFlavorLabels() {
assertEquals("Play", androidDistributionChannel("play"))
assertEquals("Third-party", androidDistributionChannel("thirdParty"))
assertEquals("Unknown", androidDistributionChannel(""))
}
}