Skip to content

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

addons/bluetooth-toggle: for Android 12 and older, and named Bluetooth Toggle on its card

Justin Newman18f2b7bbb3b6
diff --git a/addons/README.md b/addons/README.md
index 683778fb1..0c29866d3 100644
--- a/addons/README.md
+++ b/addons/README.md
@@ -33,7 +33,7 @@ the core bigger or change how it behaves. You install an add-on only if you want
| [Flock](flock/) | An interactive flocking simulation using separation, alignment and cohesion, controlled with the TV remote | CleanYourTV contributors | TCL 32S5K (Android TV 14) | None | <img src="flock/screenshot.jpg" width="240" alt="Flock on TCL Android TV"> |
| [News screensaver](news-screensaver/) | Headlines from your own RSS and Atom feeds as the TV's screensaver and as a card, one at a time with source, age, a QR code to the article and Left/Right paging; feeds (with names), seconds per headline and idle time are set with `setup.sh` or on the TV | [@modist](https://github.com/modist) | Philips 2021/22 UHD Android TV (Android 11) | `INTERNET` | <img src="news-screensaver/screenshot.jpg" width="240" alt="News screensaver on a TV"> |
| [Digital Rain](digital-rain/) | A Matrix-style screensaver: mirrored katakana and digits falling in green trails with bright heads, drawn on the TV with no network; the card starts it at once | [@dennis-oleary](https://github.com/dennis-oleary) | NVIDIA SHIELD Android TV Pro 2019 (Android TV 11) | None | <img src="digital-rain/screenshot.jpg" width="240" alt="Digital Rain on a TV"> |
-| [Bluetooth Toggle](bluetooth-toggle/) | A one-press Bluetooth switch: the tile turns Bluetooth off or on, a small panel says which, and Pair accessory is one press away | [@justin-newman](https://github.com/justin-newman) | Hisense 75U75N (hengshan), Google TV 12 | Bluetooth (`BLUETOOTH_CONNECT`) | <img src="bluetooth-toggle/screenshot.jpg" width="240" alt="Bluetooth Toggle on a TV"> |
+| [Bluetooth Toggle](bluetooth-toggle/) | For Android 12 and older (13 and newer do not let apps switch Bluetooth). A one-press Bluetooth switch: the tile turns Bluetooth off or on, a small panel says which, and Pair accessory is one press away | [@justin-newman](https://github.com/justin-newman) | Hisense 75U75N (hengshan), Google TV 12 | Bluetooth (`BLUETOOTH_CONNECT`) | <img src="bluetooth-toggle/screenshot.jpg" width="240" alt="Bluetooth Toggle on a TV"> |
A widget, an info tile, a storage or smart-home card: if it can live as its own small app, it can live
here. See the rules below.
diff --git a/addons/bluetooth-toggle/README.md b/addons/bluetooth-toggle/README.md
index ae00d6ea9..0ee3b882d 100644
--- a/addons/bluetooth-toggle/README.md
+++ b/addons/bluetooth-toggle/README.md
@@ -1,8 +1,13 @@
# Bluetooth Toggle
A one-press Bluetooth switch for the TV. For the [Clean Your TV](../../README.md) launcher it declares a
-[module card](../../docs/modules.md), so once you answer **Show card** its tile reads "Bluetooth" with a blue
-glow; on any other Android TV home it is an ordinary app.
+[module card](../../docs/modules.md), so once you answer **Show card** its tile reads "Bluetooth Toggle" with a
+blue glow; on any other Android TV home it is an ordinary app.
+
+> **For Android 12 and older.** Android 13 and newer do not let apps switch Bluetooth. There this add-on can only
+> ask Android to turn it on and send you to Settings to turn it off, which the TV's own Bluetooth settings already
+> do, so it adds nothing on those sets. The version is under About in the TV's settings; check it before
+> installing.
![The panel after switching Bluetooth off](screenshot.jpg)
@@ -10,7 +15,10 @@ glow; on any other Android TV home it is an ordinary app.
a button to switch back, and **Pair accessory**, which opens the TV's own pairing screen. It closes itself
after 5 seconds without a key press, or with Back.
- **The tile cannot show the state.** A module card's label and caption are fixed text, so the tile always reads
- "Bluetooth"; the panel says which way it went.
+ "Bluetooth Toggle"; the panel says which way it went.
+- **Not a device switcher.** [Bluetooth Connect](../bluetooth-connect/) connects or disconnects a paired speaker
+ and [Headphones](../headphones/) manages where the sound goes; this one switches the Bluetooth radio itself.
+ They can sit side by side.
- **Bluetooth remotes.** Many TV remotes pair over Bluetooth. Switch it off only if yours also works over
infrared, or you lose the remote until Bluetooth is back on (from the TV's own buttons, a phone app, or
`adb shell svc bluetooth enable`). The Hisense 75U75N remote falls back to infrared (its key presses then
@@ -53,7 +61,7 @@ Settings, then Module cards.
- **Android 13 and newer** do not let apps switch Bluetooth (`BluetoothAdapter.enable` and `disable` return
false). There, turning it on goes through Android's own "turn on Bluetooth?" prompt, and turning it off is
- left to Settings: the panel says so.
+ left to Settings: the panel says so. That is why the add-on is meant for Android 12 and older.
- Pair accessory opens `com.google.android.intent.action.CONNECT_INPUT` (Google TV and Android TV), else
Android's Bluetooth settings, else Settings.
diff --git a/addons/bluetooth-toggle/app/src/main/AndroidManifest.xml b/addons/bluetooth-toggle/app/src/main/AndroidManifest.xml
index d003b71ca..7e6d3b09c 100644
--- a/addons/bluetooth-toggle/app/src/main/AndroidManifest.xml
+++ b/addons/bluetooth-toggle/app/src/main/AndroidManifest.xml
@@ -29,7 +29,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
- <!-- Clean Your TV module card (docs/specs/card.md): the tile shows as "Bluetooth" once the owner says Show. -->
+ <!-- Clean Your TV module card (docs/specs/card.md): the tile shows as "Bluetooth Toggle" once the owner says Show. -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.gathin.tvhome.category.DOCK_CARD" />
diff --git a/addons/bluetooth-toggle/app/src/main/res/values/strings.xml b/addons/bluetooth-toggle/app/src/main/res/values/strings.xml
index fcfd204d4..91e782675 100644
--- a/addons/bluetooth-toggle/app/src/main/res/values/strings.xml
+++ b/addons/bluetooth-toggle/app/src/main/res/values/strings.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">Bluetooth</string>
+ <string name="app_name">Bluetooth Toggle</string>
<string name="state_on">Bluetooth on</string>
<string name="state_off">Bluetooth off</string>
diff --git a/addons/bluetooth-toggle/app/src/main/res/xml/module_card.xml b/addons/bluetooth-toggle/app/src/main/res/xml/module_card.xml
index 895738d02..e93929801 100644
--- a/addons/bluetooth-toggle/app/src/main/res/xml/module_card.xml
+++ b/addons/bluetooth-toggle/app/src/main/res/xml/module_card.xml
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
-<card spec="1" label="Bluetooth" caption="Switch it on and off" accent="#3D7BE0" />
+<card spec="1" label="Bluetooth Toggle" caption="On and off" accent="#3D7BE0" />