Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.
Python adbadblockandroid-tvandroid-tv-launcherapple-tvbloatware-removalclaude-codedebloatfire-tvgoogle-tvlauncherprivacysmart-tvsony-braviatclvibe-codingxiaomi
Launcher: offer App info only where the TV has an App info page (#1202)
fgarciag977413402ea8fd
diff --git a/launcher/app/src/main/AndroidManifest.xml b/launcher/app/src/main/AndroidManifest.xmlindex 80124b58a..23c8de31c 100644--- a/launcher/app/src/main/AndroidManifest.xml+++ b/launcher/app/src/main/AndroidManifest.xml@@ -38,6 +38,11 @@<intent><action android:name="android.settings.MANAGE_APPLICATIONS_SETTINGS" /></intent>+ <!-- The tile menu and the app library offer App info only where this resolves (SystemSettings.appInfo). -->+ <intent>+ <action android:name="android.settings.APPLICATION_DETAILS_SETTINGS" />+ <data android:scheme="package" />+ </intent><intent><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" />diff --git a/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.java b/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.javaindex 1b0944729..bda17c2cb 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/AppLibraryDialog.java@@ -12,10 +12,8 @@ import android.graphics.Rect;import android.graphics.drawable.ColorDrawable;import android.graphics.drawable.Drawable;import android.graphics.drawable.GradientDrawable;-import android.net.Uri;import android.os.Handler;import android.os.Looper;-import android.provider.Settings;import android.text.TextUtils;import android.view.Gravity;import android.view.KeyEvent;@@ -526,10 +524,11 @@ final class AppLibraryDialog {boolean home = onHome.test(pkg);addAction(rows, home ? R.string.library_remove_shortcut : R.string.library_add_home,() -> changeHome(app, !home));- addAction(rows, R.string.library_app_info, () -> {+ Intent info = SystemSettings.appInfo(activity, pkg);+ if (info != null) addAction(rows, R.string.library_app_info, () -> {close();try {- activity.startActivity(new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + pkg)));+ activity.startActivity(info);} catch (ActivityNotFoundException | SecurityException e) {Toast.makeText(activity, activity.getString(R.string.cant_open, label(app)), Toast.LENGTH_SHORT).show();}diff --git a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.javaindex dca4f8424..4fa776e9c 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/MainActivity.java@@ -3000,8 +3000,9 @@ public class MainActivity extends Activity implements AppAdapter.TileListener {if (LibraryApps.save(this, pkg, false)) reloadApps(false);else Toast.makeText(this, R.string.library_save_failed, Toast.LENGTH_LONG).show();});- addSettingsMenuRow(rows, popup, R.string.library_app_info, () -> open(new Intent(- Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + pkg))));+ // Some firmware has no App info page at all; a row that only toasts "can't open" helps nobody.+ Intent info = SystemSettings.appInfo(this, pkg);+ if (info != null) addSettingsMenuRow(rows, popup, R.string.library_app_info, () -> open(info));panel.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);popup.setWidth(Math.max((int) (200 * density), panel.getMeasuredWidth()));// Dock tiles sit near the bottom of the screen: open the menu above the tile when it would not fit below.diff --git a/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java b/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.javaindex 4b5fb5373..03aca91ee 100644--- a/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java+++ b/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java@@ -5,6 +5,8 @@ import android.content.Context;import android.content.Intent;import android.content.pm.PackageManager;import android.content.pm.ResolveInfo;+import android.net.Uri;+import android.provider.Settings;/** The standard settings intent, or, when nothing usable answers it, the first vendor settings entry* from settings_fallback_components that is installed (Xiaomi China, TCL / FFALCON, Fire OS). */@@ -32,4 +34,10 @@ final class SystemSettings {}return standard;}++ /** The TV's App info page for pkg, or null where the firmware has none (CVTE's settings app, #1202). */+ static Intent appInfo(Context context, String pkg) {+ Intent info = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + pkg));+ return context.getPackageManager().resolveActivity(info, PackageManager.MATCH_DEFAULT_ONLY) != null ? info : null;+ }}