android tv · accessibility service · sony bravia

Your remote,
your rules.

The Sony remote has a YouTube button and a settings button, and neither does what I want. This tiny service quietly fixes both, and adds pop-up notifications the homelab can send to the TV.

UI
none
network
none
reads screen
no, never
size
3 Kotlin files
Get it on GitHub ↗
▲▼◀▶
SONY

Projectivy

home screen

SmartTube

no ads, no nonsense

Projectivy

home screen

SettingsAppearanceChannelsWallpaperAbout

Sony settings

picture · sound · network

TvButtonRemap service connected
press the glowing buttons on the remote

Three small fixes.

Accessibility key filtering sees a key press before anything else on the TV does. That's the whole trick: catch the press, decide, and either swallow it or let it through.

KEYCODE_BUTTON_9 · 196

YouTube → SmartTube

Everywhere. If SmartTube isn't installed, the button falls through and does what it always did.

KEYCODE_BUTTON_2 · 189

Gear → Projectivy settings

Only on the Projectivy home screen. Press again inside its settings or side panels and it backs all the way out. In any other app, Sony's settings open as usual.

am broadcast · DUMP only

Pop-ups from the homelab

A bottom-right card for 12 seconds that never steals focus. Only adb can send one, so nothing else on the TV can spam you. My Jellyfin setup uses it to announce new movies.

what normally happens to the YouTube button
remote→global key table→sonyvendorservice→Google TV→YouTube
remote→TvButtonRemap→SmartTube
0network permissions
0window content read
0"display over apps" needed
∞buttons you can add

Install.

Build, install over adb, then switch the service on in Settings → Accessibility. Add your own remaps to the remaps or launcherRemaps maps in RemapService.kt.

./gradlew assembleRelease
adb connect <tv-ip>:5555
adb install -r app/build/outputs/apk/release/app-release.apk
# find any button's key code
adb logcat -s TvButtonRemap
# send a pop-up
adb shell am broadcast -n com.rusty.tvremap/.MessageReceiver \
  --es title "'Ready to watch'" --es text "'Some Movie (2003)'"