Modern Apps git

← Modern-Apps.git

tvlauncher: single HOME intent-filter, refresh default-home on resume

Commit
7632534d7f1e552576933a22c3521b93d599d324
Author
vayun-mathur <[email protected]>
When
2026-10-19 22:59 UTC (1 month ago)
Parents
52b9c39

Diff

tvlauncher/src/main/AndroidManifest.xml
diff --git a/tvlauncher/src/main/AndroidManifest.xml b/tvlauncher/src/main/AndroidManifest.xmlindex 7942ef7474..3d84cd4927 100644--- a/tvlauncher/src/main/AndroidManifest.xml+++ b/tvlauncher/src/main/AndroidManifest.xml@@ -52,8 +52,12 @@           singleTask + stateNotNeeded are what make this behave like a home app: HOME delivers           a new intent to the existing instance rather than stacking another copy, and the system           may kill it without saving state because the row order lives in DataStore, not in a-          Bundle. LEANBACK_LAUNCHER keeps it visible in other launchers' TV rows; HOME + DEFAULT-          is what lets the system offer it as the default home screen.+          Bundle.+          One filter carrying every category (the :launcher precedent): separate filters build+          separate resolve entries for the same activity, and Google TV's HOME election then+          never prefers the HOME one — query-activities lists us while resolve-activity keeps+          the stock launcher. LEANBACK_LAUNCHER keeps the app visible in other launchers' TV+          rows; HOME + DEFAULT is what lets the system offer it as the default home screen.         -->         <activity             android:name=".MainActivity"@@ -67,9 +71,6 @@             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.LEANBACK_LAUNCHER" />-            </intent-filter>-            <intent-filter>-                <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.HOME" />                 <category android:name="android.intent.category.DEFAULT" />             </intent-filter>
tvlauncher/src/main/java/com/vayunmathur/tvlauncher/MainActivity.kt
diff --git a/tvlauncher/src/main/java/com/vayunmathur/tvlauncher/MainActivity.kt b/tvlauncher/src/main/java/com/vayunmathur/tvlauncher/MainActivity.ktindex fd8663b064..ce2117ddfa 100644--- a/tvlauncher/src/main/java/com/vayunmathur/tvlauncher/MainActivity.kt+++ b/tvlauncher/src/main/java/com/vayunmathur/tvlauncher/MainActivity.kt@@ -34,8 +34,11 @@ class MainActivity : MaActivity() {     override fun onResume() {         super.onResume()         // Cheap enough to redo every time we come back: an app may have been installed or-        // uninstalled while we were away without us being alive to hear the callback.+        // uninstalled while we were away without us being alive to hear the callback. The+        // default-home check rides along so the set-default button clears itself the moment+        // the system grants the role (e.g. returning from the role prompt).         viewModel.refreshApps()+        viewModel.refreshDefaultHome(this)     }      /**