question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android TV 11 showing only Off, Idle or Standby, not recognizing running apps

See original GitHub issue

I have a TCL TV with Android TV 11 installed running on latest release HA (2021.9.7) and I the only states HA receives are Off,Idle and Standby with adb response: null in Developer - States tab.

I ran the commands through adb shell and these are the results:

~$ adb shell dumpsys power | grep 'Display Power' | grep 'state=ON' || dumpsys power | grep 'mScreenOn=true'
Display Power: state=ON
~$ adb shell getprop ro.product.manufacturer
TCL
~$ adb shell getprop ro.product.model
Smart TV Pro
~$ adb shell getprop ro.build.version.release
11
adb shell dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'

gives no response

this works

~$ adb shell dumpsys window windows | grep Window\ #1
  Window #1 Window{f978c53 u0 com.google.android.youtube.tv/com.google.android.apps.youtube.tv.activity.MainActivity}:
~$ adb shell ps -A | grep u0_a
u0_a39          410   4071       0      0 0                   0 Z [com.tcl.usercen]
u0_a72         1029    274 1270008  83388 0                   0 S com.android.systemui
u0_a78         1229    274 1237900  48308 0                   0 S com.google.android.ext.services
u0_a22         1279    274 1303284  39828 0                   0 S com.google.android.tv.remote.service
u0_a70         1302    274 1223912  39352 0                   0 S com.google.android.partnersetup
u0_a15         1361    274 1353364  75584 0                   0 S com.google.android.gms.persistent
u0_a37         1433    274 1266488  51476 0                   0 S com.google.android.inputmethod.latin
u0_a15         1566    274 1238860  41872 0                   0 S com.google.process.gservices
u0_a77         1628    274 1240776  39884 0                   0 S com.android.providers.media.module
u0_a23         1751    274 1277568  76200 0                   0 S com.google.android.tvrecommendations
u0_a27         1772    274 1318284  55712 0                   0 S com.google.android.tvlauncher
u0_a12         1912    274 1255744  42656 0                   0 S com.android.providers.tv
u0_a6          2106    274 1219396  37888 0                   0 S com.android.externalstorage
u0_a59         2593    274 1906136  49788 0                   0 S com.tcl.bi:service
u0_a16         2653    274 2034692  39224 0                   0 S com.google.android.katniss:search
u0_a55         2783    274 1900044  55384 0                   0 S com.netflix.ninja
u0_a80         2859    274 1265992  54496 0                   0 S tv.twitch.android.app
u0_a16         3028    274 1991444  38792 0                   0 S com.google.android.katniss:interactor
u0_a19         3090    274 1252588  41664 0                   0 S com.google.android.tungsten.setupwraith
u0_a15         3147    274 1296252 102184 0                   0 S com.google.android.gms
u0_a11         3218    274 1375284 107356 0                   0 S com.google.android.apps.mediashell
u0_a79         3630    274 1807528 341556 0                   0 S org.xbmc.kodi
u0_a39         4071    274 1278092  43744 0                   0 S com.tcl.usercenter
~$ CURRENT_APP=$(adb shell dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP
com.netflix.ninja
~$ CURRENT_APP=$(adb shell dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP
com.tcl.waterfall.overseas
~$ CURRENT_APP=$(adb shell dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP
com.android.vending
~$ CURRENT_APP=$(adb shell dumpsys activity a . | grep -E 'mResumedActivity' | cut -d ' ' -f 8) && CURRENT_APP=${CURRENT_APP%%/*} && echo $CURRENT_APP
tv.twitch.android.app

Here’s full output of dumpsys window and dumpsys activity starter in a gist link

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:89 (27 by maintainers)

github_iconTop GitHub Comments

13reactions
ollo69commented, Nov 3, 2021

Hey,

I will take a look to this on next days, may be next w.e., to see if I can help to split get_properties method into multiple ADB shell commands as suggested by @JeffLIrion. If you have some additional suggestion on expected implementation report it here, otherwise I will create a PR when I will have something ready to discuss on.

10reactions
JeffLIrioncommented, Jan 20, 2022

I did a lot of work to spport device-specific commands. Now all that’s needed is for someone to submit a pull request. https://github.com/JeffLIrion/python-androidtv/blob/1577e22f0137007327595340f94d0428c63791cd/androidtv/basetv/basetv.py#L94-L173

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android TV Integration only showing as Off or Idle ...
Just updated my Shield to Android 11 and HA now only sees it as idle or standby. No longer detects running app or...
Read more >
Optimize for Doze and App Standby | Android Developers
Doze and App Standby manage the behavior of all apps running on Android 6.0 or higher, ... with the screen off, the device...
Read more >
Android TV: Currently running app parsing broken ... - GitHub
Sony A80J OLED TV it is running Android 10 - State shows as idle no matter what app is currently running. Showing screenshots...
Read more >
My Android TV or Google TV turns on or off automatically - Sony
TV turns off automatically · Set Sleep timer to off. Press the gear icon · Set Idle TV standby to off. Note: Depending...
Read more >
How to prevent apps from 'sleeping' in the background on ...
Annoyingly, the root cause of this is frequently Android itself, trying to manage your phone's battery life by forcing "low" priority apps to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found