Skip to content

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

SystemSettings: extract vendorIntent for the vendor settings app

hanzg-han50e0269e4b95
diff --git a/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java b/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
index 4b5fb5373..6e9a8ecaa 100644
--- a/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
+++ b/launcher/app/src/main/java/com/gathin/tvhome/SystemSettings.java
@@ -18,7 +18,16 @@ final class SystemSettings {
// Fire OS resolves the standard actions to a CTS compliance stub that opens nothing;
// treat it as missing so the vendor fallback runs.
if (resolved != null && !resolved.activityInfo.name.contains("CTSDummy")) return standard;
+ Intent vendor = vendorIntent(context);
+ return vendor != null ? vendor : standard;
+ }
+ /** The first vendor settings entry from settings_fallback_components that is installed, or null
+ * when none is. China-market firmware keeps pages the AOSP TV settings has no row for -
+ * Xiaomi's Account & Security, where the ADB switch lives - in the vendor's own settings app;
+ * MainActivity's Settings menu offers it as "Native settings" while one is installed. */
+ static Intent vendorIntent(Context context) {
+ PackageManager pm = context.getPackageManager();
for (String value : context.getResources().getStringArray(R.array.settings_fallback_components)) {
ComponentName component = ComponentName.unflattenFromString(value);
if (component == null) continue;
@@ -30,6 +39,6 @@ final class SystemSettings {
}
return new Intent().setComponent(component);
}
- return standard;
+ return null;
}
}