Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

Launcher: a black backdrop behind the translucent Default home picker

Abu Hasan Rumi9e8b559abbaf
diff --git a/launcher/app/src/main/AndroidManifest.xml b/launcher/app/src/main/AndroidManifest.xml
index b336792d3..39d23d61b 100644
--- a/launcher/app/src/main/AndroidManifest.xml
+++ b/launcher/app/src/main/AndroidManifest.xml
@@ -141,7 +141,7 @@
android:exported="false"
android:taskAffinity=""
android:excludeFromRecents="true"
- android:theme="@android:style/Theme.NoDisplay" />
+ android:theme="@style/Theme.TvHome" />
<!-- Home button for remotes that send KEYCODE_ALL_APPS (Xiaomi). Opt-in: HOME_KEY_SERVICE=1
build-and-install.sh; see HomeKeyService. -->
<service
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/HomeSettingsActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/HomeSettingsActivity.java
index 53b2ffe5e..192189ea8 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/HomeSettingsActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/HomeSettingsActivity.java
@@ -7,23 +7,40 @@ import android.os.Bundle;
import android.provider.Settings;
import android.widget.Toast;
-/** Lets the user change HOME through the system UI, without shell or privileged permissions. */
+/** Lets the user change HOME through the system UI, without shell or privileged permissions. The picker is translucent
+ * on Android 14 (permissioncontroller), so this stays behind it as a black backdrop: over Home, its text sat on the
+ * tiles. */
public class HomeSettingsActivity extends Activity {
@Override
protected void attachBaseContext(android.content.Context base) {
super.attachBaseContext(LauncherLocale.wrap(base)); // locale
}
+ private boolean left;
+
@Override
protected void onCreate(Bundle state) {
super.onCreate(state);
+ if (state != null) return;
try {
startActivity(new Intent(Settings.ACTION_HOME_SETTINGS));
Toast.makeText(this, R.string.home_settings_help, Toast.LENGTH_LONG).show();
} catch (ActivityNotFoundException | SecurityException unavailable) {
Toast.makeText(this, R.string.not_available, Toast.LENGTH_LONG).show();
- } finally {
finish();
}
}
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ left = true;
+ }
+
+ /** Back from the picker: this screen was only the backdrop. */
+ @Override
+ protected void onResume() {
+ super.onResume();
+ if (left) finish();
+ }
}
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java
index 5df0a5196..60ea401c7 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/LauncherSettingsActivity.java
@@ -168,10 +168,8 @@ public final class LauncherSettingsActivity extends Activity {
changed();
refresh();
});
- findViewById(R.id.defaultHomeChoice).setOnClickListener(v -> {
- Toast.makeText(this, R.string.home_settings_help, Toast.LENGTH_LONG).show();
- open(new Intent(Settings.ACTION_HOME_SETTINGS));
- });
+ findViewById(R.id.defaultHomeChoice).setOnClickListener(v ->
+ open(new Intent(this, HomeSettingsActivity.class)));
findViewById(R.id.tvSettingsChoice).setOnClickListener(v ->
open(SystemSettings.intent(this, Settings.ACTION_SETTINGS)));
refresh();