Skip to content

Debloat your Android TV, install apps, browse and transfer files on it, all from your phone. Just 3 MB, no tracking, no root, no PC.

Debloat: pick your TV from its match or a maker search, no radio list

jesse-agent-3629d00d73d2f73
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 596dec4..508ab1b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,8 @@ until this file has a section for its version.
## Unreleased
+- **Improved:** Picking your TV: your match on its own, or search by maker. [#PR](../../pull/PR)
+
## 0.2.2 — 2026-10-23
- **Improved:** Checks for a new version every 30 minutes, not 6 hours. [#53](../../pull/53)
diff --git a/adb/src/main/kotlin/app/tellyscope/adb/DeviceMonitor.kt b/adb/src/main/kotlin/app/tellyscope/adb/DeviceMonitor.kt
index 1c3356c..f0ee0c0 100644
--- a/adb/src/main/kotlin/app/tellyscope/adb/DeviceMonitor.kt
+++ b/adb/src/main/kotlin/app/tellyscope/adb/DeviceMonitor.kt
@@ -21,6 +21,8 @@ data class Stats(
val temperatureC: Double? = null,
val model: String? = null,
val manufacturer: String? = null,
+ /** The name on the box; the manufacturer can be the factory (Philips TVs say TPV). */
+ val brand: String? = null,
val androidVersion: String? = null,
val sdk: Int? = null,
/** Uid → packages, from the slow tier; empty where `pm` can't list uids. */
@@ -126,6 +128,7 @@ class DeviceMonitor(
temperatureC = Parsers.temperatureC(thermal),
model = props["ro.product.model"],
manufacturer = props["ro.product.manufacturer"],
+ brand = props["ro.product.brand"],
androidVersion = props["ro.build.version.release"],
sdk = props["ro.build.version.sdk"]?.toIntOrNull(),
softwareMonth = Parsers.softwareMonth(props),
diff --git a/app/src/main/java/app/tellyscope/MainActivity.kt b/app/src/main/java/app/tellyscope/MainActivity.kt
index e73ffe7..5767177 100644
--- a/app/src/main/java/app/tellyscope/MainActivity.kt
+++ b/app/src/main/java/app/tellyscope/MainActivity.kt
@@ -208,6 +208,7 @@ fun TellyscopeApp(vm: TellyscopeViewModel) {
back = { debloat = false },
snackbar = snackbar,
source = state.listSource,
+ tvMakers = listOfNotNull(state.selected?.brand, state.selected?.manufacturer).distinct(),
)
} else {
DeviceScreen(
diff --git a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
index 99f0ca2..d54c3c0 100644
--- a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
+++ b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
@@ -570,6 +570,7 @@ class AdbDeviceSource(context: Context) : DeviceSource {
android = stats?.androidVersion,
lastSeen = link?.lastSeenMillis ?: saved[id]?.lastSeen,
nickname = names[keys[id] ?: id],
+ brand = stats?.brand,
)
}
diff --git a/app/src/main/java/app/tellyscope/data/DeviceKind.kt b/app/src/main/java/app/tellyscope/data/DeviceKind.kt
index 60971c9..6ee00fc 100644
--- a/app/src/main/java/app/tellyscope/data/DeviceKind.kt
+++ b/app/src/main/java/app/tellyscope/data/DeviceKind.kt
@@ -15,9 +15,13 @@ private val FIRE_TV = Regex("^aft|fire[ -]?tv", RegexOption.IGNORE_CASE)
private val STICK = Regex("chromecast|stick|streamer|shield", RegexOption.IGNORE_CASE)
/** Projector makers or "projector" in a name, then Amazon, then other sticks and boxes; anything else is a TV. */
-fun deviceKind(d: Device): DeviceKind {
- val words = listOfNotNull(d.manufacturer, d.hit.maker).flatMap { it.lowercase().split(Regex("[^a-z]+")) }
- val names = listOfNotNull(d.model, d.hit.hostname)
+fun deviceKind(d: Device): DeviceKind = kindOf(listOfNotNull(d.manufacturer, d.hit.maker), listOfNotNull(d.model, d.hit.hostname))
+
+/** The same guess for a debloat list, from its maker (see [listMakers]) and model name. */
+fun listKind(e: ListEntry, maker: String): DeviceKind = kindOf(listOf(maker), listOf(e.name))
+
+private fun kindOf(makers: List<String>, names: List<String>): DeviceKind {
+ val words = makers.flatMap { it.lowercase().split(Regex("[^a-z]+")) }
return when {
words.any { it in PROJECTOR_MAKERS } || names.any { "projector" in it.lowercase() } -> DeviceKind.Projector
"amazon" in words || names.any { FIRE_TV.containsMatchIn(it) } -> DeviceKind.FireTv
diff --git a/app/src/main/java/app/tellyscope/data/DeviceLists.kt b/app/src/main/java/app/tellyscope/data/DeviceLists.kt
index 24d2926..e553b99 100644
--- a/app/src/main/java/app/tellyscope/data/DeviceLists.kt
+++ b/app/src/main/java/app/tellyscope/data/DeviceLists.kt
@@ -27,6 +27,22 @@ data class ListEntry(
val sha256: String,
)
+/**
+ * Who makes each list's TV, by id. Lists carry no maker, so it is the name's first word, unless
+ * no list's id starts with that word and the list's own id prefix is a later word in the name:
+ * "Chromecast with Google TV" is Google's, while "Skyworth Coocaa K3" stays Skyworth's.
+ */
+fun listMakers(devices: List<ListEntry>): Map<String, String> {
+ fun key(w: String) = w.lowercase().filter { it.isLetterOrDigit() }
+ val prefixes = devices.map { it.id.substringBefore('-') }.toSet()
+ return devices.associate { e ->
+ val words = e.name.split(' ').filter { it.isNotBlank() }
+ val prefix = e.id.substringBefore('-')
+ val first = words.firstOrNull() ?: prefix
+ e.id to if (key(first) in prefixes) first else words.firstOrNull { key(it) == prefix } ?: first
+ }
+}
+
data class ListIndex(val commit: String?, val devices: List<ListEntry>)
data class ListPackage(val pkg: String, val note: String?, val optional: Boolean)
diff --git a/app/src/main/java/app/tellyscope/data/Model.kt b/app/src/main/java/app/tellyscope/data/Model.kt
index 8948396..35d0cdd 100644
--- a/app/src/main/java/app/tellyscope/data/Model.kt
+++ b/app/src/main/java/app/tellyscope/data/Model.kt
@@ -47,6 +47,8 @@ data class Device(
val lastSeen: Long?,
/** The name the user gave it; wins over the network name. */
val nickname: String? = null,
+ /** `ro.product.brand`, which can differ from [manufacturer]. */
+ val brand: String? = null,
)
sealed interface ConnectResult {
diff --git a/app/src/main/java/app/tellyscope/ui/ListsCard.kt b/app/src/main/java/app/tellyscope/ui/ListsCard.kt
index a975aeb..f9f0da4 100644
--- a/app/src/main/java/app/tellyscope/ui/ListsCard.kt
+++ b/app/src/main/java/app/tellyscope/ui/ListsCard.kt
@@ -3,6 +3,7 @@
package app.tellyscope.ui
import androidx.activity.compose.BackHandler
+import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
@@ -13,22 +14,30 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.heightIn
+import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
+import androidx.compose.foundation.selection.selectable
+import androidx.compose.foundation.text.KeyboardActions
+import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
+import androidx.compose.material.icons.filled.Check
+import androidx.compose.material.icons.filled.Clear
+import androidx.compose.material.icons.filled.Search
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.Checkbox
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
+import androidx.compose.material3.ListItem
+import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
-import androidx.compose.material3.RadioButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
@@ -46,9 +55,16 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.platform.LocalSoftwareKeyboardController
+import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.unit.dp
+import app.tellyscope.data.ListEntry
import app.tellyscope.data.Suggested
import app.tellyscope.data.Suggestions
+import app.tellyscope.data.listKind
+import app.tellyscope.data.listMakers
import app.tellyscope.data.sourceName
/** Body of the "Suggested for this TV" section: one line on what the list offers; the Debloat tile is the way in. */
@@ -80,11 +96,11 @@ private fun Muted(text: String) {
}
/**
- * Debloat in two steps. First the TV's model: the matched list is chosen, any other can be, and
- * an unknown model starts with nothing chosen. Then every app that list would turn off, ticked as
- * the list says, with a final confirm that names each one.
+ * Debloat in two steps. First the TV's model: the matched list on its own, with a way to change
+ * it; an unknown model starts at a search for the TV's maker, with nothing chosen. Then every
+ * app that list would turn off, ticked as the list says, with a final confirm that names each one.
*/
-@OptIn(ExperimentalMaterial3Api::class)
+@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
@Composable
fun DebloatScreen(
lists: Suggestions?,
@@ -94,6 +110,8 @@ fun DebloatScreen(
snackbar: SnackbarHostState = remember { SnackbarHostState() },
/** The user's own list source, null for the default; set in Settings. */
source: String? = null,
+ /** The TV's brand, then its manufacturer; the first that names a list starts the search. */
+ tvMakers: List<String> = emptyList(),
) {
val ready = lists as? Suggestions.Ready
val devices = when (lists) {
@@ -103,7 +121,14 @@ fun DebloatScreen(
}
var step by rememberSaveable { mutableIntStateOf(1) }
var chosen by rememberSaveable { mutableStateOf(ready?.list?.id) }
- var q by rememberSaveable { mutableStateOf("") }
+ // The matched list shows on its own; "Change", or no match, opens the search.
+ var searching by rememberSaveable { mutableStateOf(false) }
+ val makers = remember(devices) { listMakers(devices) }
+ fun finds(term: String) = devices.filter { it.name.contains(term, ignoreCase = true) || makers.getValue(it.id).contains(term, ignoreCase = true) }
+ // Nobody typed the prefill, so a maker no list names shows the full list, not "No results".
+ val prefill = remember(devices) { tvMakers.map { it.trim() }.firstOrNull { it.isNotEmpty() && finds(it).isNotEmpty() } }
+ var typed by rememberSaveable { mutableStateOf<String?>(null) }
+ val q = typed ?: prefill.orEmpty()
// Ticks start from the list and reset whenever it reloads.
var ticked by remember(lists) {
mutableStateOf(ready?.groups.orEmpty().flatMap { it.packages }.filter { it.ticked }.map { it.pkg }.toSet())
@@ -115,7 +140,15 @@ fun DebloatScreen(
val apps = showing.groups.flatMap { it.packages }.filter { it.pkg in ticked }
DisableDialog(apps, onDisable = { confirming = false; onDisable(apps.map { it.pkg }); back() }, onDismiss = { confirming = false })
}
- val goBack = { if (step == 2) step = 1 else back() }
+ val next = { chosen?.let { if (it != ready?.list?.id) onPick(it) }; step = 2 }
+ val keyboard = LocalSoftwareKeyboardController.current
+ val goBack = {
+ when {
+ step == 2 -> step = 1
+ searching && ready != null -> searching = false
+ else -> back()
+ }
+ }
BackHandler(onBack = goBack)
Scaffold(
@@ -134,11 +167,12 @@ fun DebloatScreen(
)
},
bottomBar = {
- Surface(tonalElevation = 3.dp) {
+ // Above the keyboard while the search is typed into.
+ Surface(tonalElevation = 3.dp, modifier = Modifier.imePadding()) {
Box(Modifier.fillMaxWidth().navigationBarsPadding().padding(16.dp)) {
if (step == 1) {
Button(
- onClick = { chosen?.let { if (it != ready?.list?.id) onPick(it) }; step = 2 },
+ onClick = next,
enabled = chosen != null,
modifier = Modifier.fillMaxWidth(),
) { Text("Next") }
@@ -154,36 +188,58 @@ fun DebloatScreen(
},
) { pad ->
if (step == 1) {
- // The matched list first, then the rest by name.
- val shown = devices
- .filter { q.isBlank() || it.name.contains(q.trim(), ignoreCase = true) }
- .sortedWith(compareBy({ it.id != ready?.list?.id }, { it.name.lowercase() }))
- LazyColumn(Modifier.fillMaxSize().padding(pad), contentPadding = PaddingValues(horizontal = 16.dp, vertical = 8.dp)) {
+ val picked = devices.firstOrNull { it.id == chosen }
+ LazyColumn(
+ Modifier.fillMaxSize().padding(pad),
+ contentPadding = PaddingValues(horizontal = 16.dp, vertical = 8.dp),
+ verticalArrangement = Arrangement.spacedBy(4.dp),
+ ) {
+ if (!searching && ready != null && picked != null) {
+ // A match or an earlier pick: just that one, and a way to change it.
+ item {
+ Text("Tellyscope uses this list for your TV.", style = MaterialTheme.typography.bodyMedium, modifier = Modifier.padding(bottom = 8.dp))
+ ListRow(picked, makers.getValue(picked.id), selected = true, onClick = null)
+ TextButton(onClick = { searching = true }, modifier = Modifier.padding(top = 4.dp)) { Text("Change") }
+ }
+ return@LazyColumn
+ }
item {
- Text(
- if (ready != null) "Tellyscope matched this TV to the ${ready.list.name} list. Pick another model if that's wrong."
- else "Tellyscope doesn't know this model yet. Pick the closest match.",
- style = MaterialTheme.typography.bodyMedium,
- )
OutlinedTextField(
- q, { q = it },
+ q, { typed = it },
placeholder = { Text("Brand or model") },
+ leadingIcon = { Icon(Icons.Filled.Search, contentDescription = null) },
+ trailingIcon = {
+ if (q.isNotEmpty()) IconButton(onClick = { typed = "" }) { Icon(Icons.Filled.Clear, contentDescription = "Clear search") }
+ },
singleLine = true,
- modifier = Modifier.fillMaxWidth().padding(vertical = 8.dp),
+ // The keyboard's action key closes it, and moves on once a TV is picked.
+ keyboardOptions = KeyboardOptions(imeAction = ImeAction.Done),
+ keyboardActions = KeyboardActions(onDone = { keyboard?.hide(); if (chosen != null) next() }),
+ modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp),
)
- // Empty while a picked list reloads, if they came back to change it.
- if (devices.isEmpty()) Muted("Loading the lists…")
- else if (shown.isEmpty()) Muted("No list matches \"${q.trim()}\".")
}
- items(shown, key = { it.id }) { d ->
- Row(
- Modifier.fillMaxWidth().clip(MaterialTheme.shapes.medium).clickable { chosen = d.id }.padding(vertical = 4.dp),
- verticalAlignment = Alignment.CenterVertically,
- ) {
- RadioButton(d.id == chosen, onClick = null)
- Spacer(Modifier.width(12.dp))
- Text(d.name, style = MaterialTheme.typography.bodyLarge)
+ // Empty while a picked list reloads, if they came back to change it.
+ if (devices.isEmpty()) {
+ item { Muted("Loading the lists…") }
+ return@LazyColumn
+ }
+ val term = q.trim()
+ val shown = if (term.isEmpty()) emptyList() else finds(term).sortedBy { it.name.lowercase() }
+ // What found nothing: their search, or else the TV's own maker.
+ val missed = term.ifEmpty { if (typed == null) tvMakers.firstOrNull()?.trim()?.ifEmpty { null } else null }
+ if (shown.isNotEmpty()) {
+ items(shown, key = { it.id }) { d -> ListRow(d, makers.getValue(d.id), d.id == chosen) { chosen = d.id } }
+ return@LazyColumn
+ }
+ if (missed != null) item { Muted("No list for \u201c$missed\u201d. Pick the closest model.") }
+ // Every list, by maker, with the maker in view while scrolling.
+ devices.groupBy { makers.getValue(it.id).lowercase().filter(Char::isLetterOrDigit) }.toSortedMap().forEach { (key, group) ->
+ stickyHeader(key = "m:$key") {
+ Surface(color = MaterialTheme.colorScheme.background, modifier = Modifier.fillMaxWidth()) {
+ Text(makers.getValue(group.first().id), style = MaterialTheme.typography.titleSmall, modifier = Modifier.padding(top = 12.dp, bottom = 4.dp))
+ }
}
+ items(group.sortedBy { it.name.lowercase() }, key = { it.id }) { d -> ListRow(d, makers.getValue(d.id), d.id == chosen) { chosen = d.id } }
}
}
} else {
@@ -291,3 +347,36 @@ fun AboutDialog(commit: String?, onDismiss: () -> Unit) {
confirmButton = { TextButton(onClick = onDismiss) { Text("Close") } },
)
}
+
+/** "Android 11" for SDK 30; just the SDK where the release name isn't known. */
+private fun androidName(sdk: Int): String = when (sdk) {
+ 26 -> "Android 8"
+ 27 -> "Android 8.1"
+ 28 -> "Android 9"
+ 32 -> "Android 12L"
+ in 29..31 -> "Android ${sdk - 19}"
+ in 33..36 -> "Android ${sdk - 20}"
+ else -> "API $sdk"
+}
+
+/** One list in the picker: the kind of device, the model and the Android it was tested on. The chosen one is tinted and ticked. */
+@Composable
+private fun ListRow(e: ListEntry, maker: String, selected: Boolean, onClick: (() -> Unit)?) {
+ val kind = listKind(e, maker)
+ val pick = if (onClick == null) Modifier else Modifier.selectable(selected, role = Role.RadioButton, onClick = onClick)
+ ListItem(
+ headlineContent = { Text(e.name) },
+ // The maker is already in the name; say what the list was tested on instead.
+ supportingContent = { Text(listOfNotNull(kind.word(), e.sdk?.let(::androidName)).joinToString(" · ")) },
+ leadingContent = { Icon(DeviceIcons.of(kind), contentDescription = kind.word()) },
+ trailingContent = if (selected) ({ Icon(Icons.Filled.Check, contentDescription = null) }) else null,
+ colors = if (selected) ListItemDefaults.colors(
+ containerColor = MaterialTheme.colorScheme.secondaryContainer,
+ headlineColor = MaterialTheme.colorScheme.onSecondaryContainer,
+ supportingColor = MaterialTheme.colorScheme.onSecondaryContainer,
+ leadingIconColor = MaterialTheme.colorScheme.onSecondaryContainer,
+ trailingIconColor = MaterialTheme.colorScheme.onSecondaryContainer,
+ ) else ListItemDefaults.colors(containerColor = Color.Transparent),
+ modifier = Modifier.fillMaxWidth().clip(MaterialTheme.shapes.large).then(pick),
+ )
+}
diff --git a/app/src/test/java/app/tellyscope/DeviceKindTest.kt b/app/src/test/java/app/tellyscope/DeviceKindTest.kt
index 09d6b0f..35d9de7 100644
--- a/app/src/test/java/app/tellyscope/DeviceKindTest.kt
+++ b/app/src/test/java/app/tellyscope/DeviceKindTest.kt
@@ -7,7 +7,10 @@ import app.tellyscope.data.DeviceKind
import app.tellyscope.data.DeviceState
import app.tellyscope.data.ScanHit
import app.tellyscope.data.ScanKind
+import app.tellyscope.data.ListEntry
import app.tellyscope.data.deviceKind
+import app.tellyscope.data.listKind
+import app.tellyscope.data.listMakers
import org.junit.Assert.assertEquals
import org.junit.Test
@@ -47,4 +50,33 @@ class DeviceKindTest {
/** "aft" only counts at the start of a model, so a name that merely contains it stays a TV. */
@Test fun aftOnlyAsAPrefix() = assertEquals(DeviceKind.Tv, kind(manufacturer = "Philips", model = "Craft 55"))
+
+ private fun entry(id: String, name: String) = ListEntry(id, name, null, null, "devices/$id.json", "0".repeat(64))
+
+ /** Lists carry no maker: it comes from the name, or the id when the name starts with a product. */
+ @Test fun listMakersFromTheName() {
+ val lists = listOf(
+ entry("xgimi-horizon-s-pro", "XGIMI Horizon S Pro projector"),
+ entry("skyworth-q72", "Skyworth Q72"),
+ entry("coocaa-k3-pro", "Skyworth Coocaa K3 Pro"),
+ entry("google-chromecast-gtv-4k", "Chromecast with Google TV 4K"),
+ entry("ok-ai-pont", "OK. \"AI PONT\""),
+ )
+ assertEquals(
+ mapOf(
+ "xgimi-horizon-s-pro" to "XGIMI", "skyworth-q72" to "Skyworth", "coocaa-k3-pro" to "Skyworth",
+ "google-chromecast-gtv-4k" to "Google", "ok-ai-pont" to "OK.",
+ ),
+ listMakers(lists),
+ )
+ }
+
+ /** The picker's icons use the same guess as the TV's own. */
+ @Test fun listKinds() {
+ assertEquals(DeviceKind.Projector, listKind(entry("xgimi-mogo-3", "XGIMI MoGo 3 Pro"), "XGIMI"))
+ assertEquals(DeviceKind.Projector, listKind(entry("epson-ls800", "Epson LS800 laser projector"), "Epson"))
+ assertEquals(DeviceKind.FireTv, listKind(entry("amazon-fire-tv-stick-4k", "Amazon Fire TV Stick 4K"), "Amazon"))
+ assertEquals(DeviceKind.Stick, listKind(entry("google-chromecast-gtv-4k", "Chromecast with Google TV 4K"), "Google"))
+ assertEquals(DeviceKind.Tv, listKind(entry("sony-bravia-x90j", "Sony Bravia X90J"), "Sony"))
+ }
}
diff --git a/app/src/test/java/app/tellyscope/ScreenshotTest.kt b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
index 456aa8f..6a50caa 100644
--- a/app/src/test/java/app/tellyscope/ScreenshotTest.kt
+++ b/app/src/test/java/app/tellyscope/ScreenshotTest.kt
@@ -175,10 +175,13 @@ class ScreenshotTest {
/** The fake's list, among a few other models so "Which TV is this?" has a choice. */
private suspend fun lists(id: String): Suggestions.Ready {
val ready = fake.suggestions(id) as Suggestions.Ready
- val others = listOf("Sony Bravia (Google TV)", "TCL C-series", "Xiaomi Mi Box S").map {
- val slug = it.lowercase().replace(Regex("[^a-z]+"), "-").trim('-')
+ val others = listOf(
+ "XGIMI MoGo 2 projector", "XGIMI MoGo 3 Pro projector", "Philips 55OLED708",
+ "Sony Bravia (Google TV)", "TCL C-series", "Xiaomi Mi Box S",
+ ).map {
+ val slug = it.lowercase().replace(Regex("[^a-z0-9]+"), "-").trim('-')
ListEntry(slug, it, null, 30, "devices/$slug.json", "0".repeat(64))
- }
+ } + ListEntry("google-chromecast-gtv-4k", "Chromecast with Google TV 4K", null, 34, "devices/google-chromecast-gtv-4k.json", "0".repeat(64))
return ready.copy(devices = ready.devices + others)
}
@@ -514,14 +517,46 @@ class ScreenshotTest {
@Test fun debloat_pick() {
val lists = deviceState().device.lists
- shot("18_debloat_pick") { DebloatScreen(lists, {}, {}, {}) }
- compose.onNodeWithText("Next").assertIsEnabled() // the matched list is already chosen
+ shot("18_debloat_pick") { DebloatScreen(lists, {}, {}, {}, tvMakers = listOf("XGIMI")) }
+ // The match on its own, already chosen, with a way to change it; no list of every model.
+ compose.onNodeWithText("Next").assertIsEnabled()
+ compose.onNodeWithText("Change").assertExists()
+ compose.onNodeWithText("TCL C-series").assertDoesNotExist()
+ }
+
+ @Test fun debloat_pick_change() {
+ val lists = deviceState().device.lists
+ val change = { compose.onNodeWithText("Change").performClick(); Unit }
+ shot("18_debloat_pick_change", before = change) { DebloatScreen(lists, {}, {}, {}, tvMakers = listOf("XGIMI")) }
+ // The search starts at the TV's maker, and the match stays chosen.
+ compose.onNodeWithText("XGIMI MoGo 2 projector").assertExists()
+ compose.onNodeWithText("TCL C-series").assertDoesNotExist()
+ compose.onNodeWithText("Next").assertIsEnabled()
+ }
+
+ @Test fun debloat_pick_brand() {
+ // Philips TVs report their factory, TPV, as manufacturer; the brand finds the list.
+ val ready = deviceState().device.lists as Suggestions.Ready
+ shot("18_debloat_pick_brand") { DebloatScreen(Suggestions.Pick(null, ready.devices), {}, {}, {}, tvMakers = listOf("Philips", "TPV")) }
+ compose.onNodeWithText("Philips 55OLED708").assertExists()
+ compose.onNodeWithText("No list for", substring = true).assertDoesNotExist()
+ compose.onNodeWithText("Next").assertIsNotEnabled() // found, but not picked for them
}
@Test fun debloat_unknownModel() {
+ // A maker no list names: the full list, with a line saying so, and nothing guessed.
+ val ready = deviceState().device.lists as Suggestions.Ready
+ shot("18_debloat_pick_unknown") { DebloatScreen(Suggestions.Pick(null, ready.devices), {}, {}, {}, tvMakers = listOf("TPV")) }
+ compose.onNodeWithText("No list for \u201cTPV\u201d", substring = true).assertExists()
+ compose.onNodeWithText("Chromecast with Google TV 4K").assertExists()
+ compose.onNodeWithText("Next").assertIsNotEnabled()
+ }
+
+ @Test fun debloat_pickByHand() {
val ready = deviceState().device.lists as Suggestions.Ready
- shot("18_debloat_pick_unknown") { DebloatScreen(Suggestions.Pick(null, ready.devices), {}, {}, {}) }
- compose.onNodeWithText("Next").assertIsNotEnabled() // nothing guessed for a model it doesn't know
+ val pick = { compose.onNodeWithText("Philips 55OLED708").performClick(); Unit }
+ shot("18_debloat_pick_manual", before = pick) { DebloatScreen(Suggestions.Pick(null, ready.devices), {}, {}, {}, tvMakers = listOf("TPV")) }
+ compose.onNodeWithText("Next").assertIsEnabled()
}
@Test fun debloat_review() {