android - Using MediaSessionManager.OnActiveSessionsChangedListener on AndroidTV -
i'm trying listen changes active media sessions on android tv (specifically set hue lights sort of "movie mode"). on normal android device (4.3+) i'd set notificationlistenerservice allow me call mediasessionmanager.addonactivesessionschangedlistener().
the problem android tv doesn't seem have ui enable notificationlistenerservice, , there nothing handle settings.action_notification_listener_settings. know of approach listen media changes or way enable notificationlistenerservice on android tv? own use, doesn't need scalable solution (adb fine).
from adb shell:
- get current list of enabled notification listeners:
settings secure enabled_notification_listeners
by default on tv, returns com.google.android.leanbacklauncher/.notifications.notificationmonitorservice.
- add yours list, separated colon.
settings put secure enabled_notification_listeners com.google.android.leanbacklauncher/.notifications.notificationmonitorservice:com.example/com.example.mynotificationlistenerservice
Comments
Post a Comment