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.

Leave built-in phone-style apps out of the dock picker

jesse-agent-821a75bb26bdfbe
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ac227b..8543c97 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@ until this file has a section for its version.
## Unreleased
- **Fixed:** Apps show their real icon, not a banner strip or letter. [#136](../../pull/136)
+- **Improved:** The dock picker leaves out built-in phone-style apps like Camera. [#138](../../pull/138)
## 0.8.1 — 2026-10-25
diff --git a/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt b/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
index 4d5b75f..b357ce6 100644
--- a/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
+++ b/adb/src/main/kotlin/app/tellyscope/adb/Actions.kt
@@ -136,6 +136,10 @@ class Actions(private val shell: AdbShell) {
suspend fun launchable(): Set<String>? =
packagesIn(shell.shell(Commands.LAUNCHABLE).output).ifEmpty { null }
+ /** The [launchable] packages with a TV home-screen icon; null when the TV lists none of that kind. */
+ suspend fun tvLaunchable(): Set<String>? =
+ packagesIn(shell.shell("${Commands.TV_LAUNCHABLE} 2>/dev/null").output).ifEmpty { null }
+
/** [pkg]'s accessibility service as the TV has it installed; null when it has none. */
suspend fun homeService(pkg: String): String? =
activitiesIn(shell.shell(Commands.A11Y_SERVICES).output).firstOrNull { it.substringBefore('/') == pkg }
diff --git a/adb/src/main/kotlin/app/tellyscope/adb/Commands.kt b/adb/src/main/kotlin/app/tellyscope/adb/Commands.kt
index dfe7d2f..6d0bcb0 100644
--- a/adb/src/main/kotlin/app/tellyscope/adb/Commands.kt
+++ b/adb/src/main/kotlin/app/tellyscope/adb/Commands.kt
@@ -45,6 +45,8 @@ internal object Commands {
const val HOME_ACTIVITY = "cmd package resolve-activity --brief -a android.intent.action.MAIN -c android.intent.category.HOME"
const val SET_HOME = "cmd package set-home-activity --user 0"
const val HOME_ACTIVITIES = "cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.HOME"
+ /** Apps with an icon on a TV home screen. */
+ const val TV_LAUNCHABLE = "cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.LEANBACK_LAUNCHER"
/** Apps with an icon on a TV home screen, then those with one on a phone's; some TVs list only one kind. */
const val LAUNCHABLE =
"cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.LEANBACK_LAUNCHER 2>/dev/null; " +
diff --git a/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt b/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt
index 72954f9..8ce01d4 100644
--- a/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt
+++ b/adb/src/test/kotlin/app/tellyscope/adb/ActionsTest.kt
@@ -288,6 +288,14 @@ class ActionsTest {
assertEquals(setOf("com.google.android.youtube.tv", "org.jellyfin.androidtv"), Actions(sh).launchable())
}
+ @Test fun tvLaunchableAsksForTvHomeIconsOnly() = runTest {
+ val sh = FakeShell(mapOf("cmd package query-activities --brief -a android.intent.action.MAIN -c android.intent.category.LEANBACK_LAUNCHER" to ok(
+ "com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.ShellActivity\n",
+ )))
+ assertEquals(setOf("com.google.android.youtube.tv"), Actions(sh).tvLaunchable())
+ assertEquals(null, Actions(FakeShell(mapOf("cmd package" to ok("")))).tvLaunchable())
+ }
+
@Test fun launchableIsUnknownWithoutCmd() = runTest {
val sh = FakeShell(mapOf("cmd package" to ShellResult("", 127)))
assertEquals(null, Actions(sh).launchable())
diff --git a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
index 1ad02c2..34824ca 100644
--- a/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
+++ b/app/src/main/java/app/tellyscope/data/AdbDeviceSource.kt
@@ -336,6 +336,7 @@ class AdbDeviceSource(context: Context) : DeviceSource {
val userInstalled = Parsers.packages(shell.shell("pm list packages -3").output).map { it.name }.toSet()
// Before Android 7 there's no asking which apps have an icon; the ones the user installed do.
val launchable = Actions(shell).launchable() ?: userInstalled
+ val tvHome = Actions(shell).tvLaunchable() ?: launchable
// Older pm rejects --show-versioncode and prints no packages; list again without it.
val listed = Parsers.packages(shell.shell("pm list packages --show-versioncode").output)
.ifEmpty { Parsers.packages(shell.shell("pm list packages").output) }
@@ -371,6 +372,7 @@ class AdbDeviceSource(context: Context) : DeviceSource {
homeService = p.name in serviceLaunchers,
listKeep = p.name in keep,
launchable = p.name in launchable,
+ tvHome = p.name in tvHome,
)
}.sortedBy { it.label.lowercase() }
}
diff --git a/app/src/main/java/app/tellyscope/data/DockBook.kt b/app/src/main/java/app/tellyscope/data/DockBook.kt
index 5b4b4b4..1bbfd11 100644
--- a/app/src/main/java/app/tellyscope/data/DockBook.kt
+++ b/app/src/main/java/app/tellyscope/data/DockBook.kt
@@ -58,8 +58,12 @@ object Dock {
/** One row of four under Back and Home; "Add to dock" goes once it's full. */
const val MAX = 4
- /** The apps the picker offers: ones a launcher can open, already-docked ones included (shown as Added). */
- fun choices(apps: List<AppInfo>): List<AppInfo> = apps.filter { it.launchable && it.enabled }
+ /**
+ * The apps the picker offers: ones a launcher can open, already-docked ones included (shown as Added).
+ * A built-in app with only a phone-style icon (Camera, WebView, a maker's updater) is left out; one
+ * the user installed stays, whatever kind of icon it has.
+ */
+ fun choices(apps: List<AppInfo>): List<AppInfo> = apps.filter { it.launchable && it.enabled && (it.tvHome || !it.system) }
fun add(dock: List<Docked>, app: AppInfo): List<Docked> =
if (dock.size >= MAX || dock.any { it.packageName == app.packageName }) dock else dock + Docked(app.packageName, app.label)
diff --git a/app/src/main/java/app/tellyscope/data/Model.kt b/app/src/main/java/app/tellyscope/data/Model.kt
index 4f2707f..ced25e9 100644
--- a/app/src/main/java/app/tellyscope/data/Model.kt
+++ b/app/src/main/java/app/tellyscope/data/Model.kt
@@ -129,6 +129,8 @@ data class AppInfo(
val listKeep: Boolean = false,
/** Has an icon on a launcher, so the Remote's dock can open it. */
val launchable: Boolean = false,
+ /** Has an icon on the TV's own home screen, not only a phone-style one. True when the TV can't say. */
+ val tvHome: Boolean = true,
)
/** An app on the Remote's dock. [label] is kept so it can be named after the app is gone. */
diff --git a/app/src/test/java/app/tellyscope/DockTest.kt b/app/src/test/java/app/tellyscope/DockTest.kt
index f900234..6feece0 100644
--- a/app/src/test/java/app/tellyscope/DockTest.kt
+++ b/app/src/test/java/app/tellyscope/DockTest.kt
@@ -55,6 +55,13 @@ class DockTest {
assertEquals(listOf("com.a"), Dock.choices(apps).map { it.packageName })
}
+ @Test fun thePickerLeavesOutBuiltInPhoneStyleApps() {
+ val camera = AppInfo("com.android.camera2", "Camera", null, true, true, null, "", launchable = true, tvHome = false)
+ val settings = AppInfo("com.android.tv.settings", "Settings", null, true, true, null, "", launchable = true, tvHome = true)
+ val sideloaded = app("com.example.phoneapp").copy(tvHome = false)
+ assertEquals(listOf("com.android.tv.settings", "com.example.phoneapp"), Dock.choices(listOf(camera, settings, sideloaded)).map { it.packageName })
+ }
+
@Test fun theBookKeepsOrderAcrossARestartAndFollowsARekey() {
val file = File(Files.createTempDirectory("dock").toFile(), "docks.tsv")
DockBook(file).apply {