Skip to content
This repository has been archived by the owner on Aug 19, 2023. It is now read-only.

Compatibility with Android TV #9

Open
Twanislas opened this issue Feb 7, 2020 · 33 comments
Open

Compatibility with Android TV #9

Twanislas opened this issue Feb 7, 2020 · 33 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Twanislas
Copy link

Hi !

It would be very useful to add compatibility with Android TV so users could install the app from the play store on set top boxes instead of sideloading.

Thanks for your consideration :)

Context: JeffLIrion/python-androidtv#18 (comment)

@d4rken
Copy link
Member

d4rken commented Feb 13, 2020

Playstore needs a few extra graphics for Android TV, I can look into that.

We would also need to make sure that the menu can be navigated by remote, I have not looked into how good that currently works. Feel free to help out with that :).

@bieniu
Copy link

bieniu commented Feb 13, 2020

@d4rken Wakelock menu can be navigated by remote on Xiaomi Mi Box 3 (Android TV 8.0) without any problems. I checked yesterday.

@Twanislas
Copy link
Author

+1 on what @bieniu said. I can confirm it works ok on a Mibox S (4) (ATV 9.0). That being said, it's not the perfect interface for ATV but since it's kinda "set it once and forget it" that's pretty ok.

@CreaaZ
Copy link

CreaaZ commented Mar 17, 2020

I can confirm it is running on Sony Bravia TV KD-55X8505C as intended. Navigation with remote is also fine - installed via ADB.

@magicse
Copy link

magicse commented Apr 16, 2020

After last update (2604) of MiBox S(4) (ATV 9.0), Wakelock not work and MiBox S stay in deep sleep.

@potatoxbe
Copy link

After last update (2604) of MiBox S(4) (ATV 9.0), Wakelock not work and MiBox S stay in deep sleep.

Yes same issue here.

@keizie
Copy link

keizie commented Apr 23, 2020

After last update (2604) of MiBox S(4) (ATV 9.0), Wakelock not work and MiBox S stay in deep sleep.

FYI, USB Ethernet (connected to MiBox S) LEDs turns on and off soon, periodically.
iPhone can connect to MIBOX4 when the time is right.

@orholly
Copy link

orholly commented Apr 24, 2020

After last update (2604) of MiBox S(4) (ATV 9.0), Wakelock not work and MiBox S stay in deep sleep.

Yes same issue here.

Me too.

@d4rken
Copy link
Member

d4rken commented Apr 24, 2020

There is no specific change required in the app. This is likely a ROM change that increases restrictions on battery consumptions. Somewhere in the the system settings is likely a menu where you can exclude wakelock-revamp from these restrictions.

@magicse
Copy link

magicse commented Apr 24, 2020

There is no specific change required in the app. This is likely a ROM change that increases restrictions on battery consumptions. Somewhere in the the system settings is likely a menu where you can exclude wakelock-revamp from these restrictions.

Interesting moment - after restart of mi box S with installed and activated WakeLock , wakelock does everything right, and does not allow the device to go into deep sleep ... but it does it only once and after waking up, this does not happen anymore until the next reboot. It looks like the service is not restarting
I try recompile wakelock in android studio... but the same.... I know in android 8.0 there are many problems with background services.... on android And I know that people must use foreground service and notify channel....to keep process running, but may be something else in android 9.0
Also I exclude Wakelock from power optimisation.

@d4rken
Copy link
Member

d4rken commented Apr 24, 2020

It looks like the service is not restarting

Check whether the notification is visible. If it's visible, then the app is doing it's job. If the notification is not visible (and thus the service not started), then there might be an issue.

@magicse
Copy link

magicse commented Apr 24, 2020

no any notifications....

@magicse
Copy link

magicse commented Apr 24, 2020

Also I found this
Android TV: application notifications on O+
Android TV limitations

In case if you will follow any available tutorial to publish notification via notification channel on the Android TV — it will not work. In the logcat you will see the next message:

TVNotifService: skipped notification StatusBarNotification(pkg=com.my.application user=UserHandle{0} id=2 tag=MyChannel key=0|com.my.application|2|MyChannel|1000: Notification(channel=MyChannel pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x100 color=0xff048f80 category=sys vis=PUBLIC)) userId: 0

Notification is ignored, this seems totally unexpected to anybody who was working with the notification channels on Android phones, but due to Android TV specific UI/UX — notifications are allowed only for the system white-listed application
https://medium.com/@igor.stebliy/android-tv-application-notifications-on-o-c6820ada2086

@d4rken
Copy link
Member

d4rken commented Apr 25, 2020

That could be an explanation... We can't modify the ROM and whitelist the package... 🤔

@magicse
Copy link

magicse commented Apr 25, 2020

Here is example of notification wrapper for android Tv
https://medium.com/@igor.stebliy/android-tv-application-notifications-on-o-c6820ada2086

@d4rken
Copy link
Member

d4rken commented Apr 28, 2020

You will need to have access to the AOSP sources to white-list your application and configure proper access to the system API.

@magicse
Copy link

magicse commented Apr 30, 2020

ok

@saarsinai
Copy link

mi box s, latest android version (9), wakelock side loaded, gave all permission, load on startup, power optimization turned off, none made the mi box stay awake after pressing the power button

@arefin932
Copy link

I am getting "Ethernet not Connected" error every time my Xiaomi Mi Box S wakes up from sleep. I have to unplug and replug the USB Ethernet adapter or reboot the box to make the USB Ethernet recognized. Wakelock was working fine until I upgraded my Box to Android 9 (2604). I have done factory reset on my device after the upgrade but no luck. I have "load on startup" checked in the wakelock with the following options, power optimization turned off for Wakelock on the Mibox. But still no luck.
https://imgur.com/S0kHOY8

@magicse
Copy link

magicse commented May 21, 2020

Powermanager has very aggressive save mode. And Wfi, CEC, USB, partial_wake_locks not work in sleep mode at all! (exclude Bluetooth)
Thant is why Wifi (Chromecast) or phone app remote control or CEC can't wake up device from sleep mode.

Here link to bug reports BUG REPORT Mi Box S.... write there about this problem

@VoyteckPL
Copy link

I have usb dongle remote control which works great when Mi Box S is turned on. I can turn it off via Usb remote but I can't turn it on back again. Only bluetooth remote can turn Mi Box S on.

@darkkatarsis
Copy link

Same here. After updating Mi box to android 9, wakelock stopped working. Someone has already found a workaround?

Ps. eth from usb not working either

@IgorEisberg
Copy link

Yep, same issue with Mi Box 3 after update to Android 9. Basically, rendered a universal wireless+IR remote useless, including Xiaomi's own Mi Remote app. (same issue as @VoyteckPL described, no matter what sent the IR signal to put the Mi Box to sleep)
You will also see in that broken sleep state that the remote is losing connection with the Mi Box completely, and the remote's LED will be flashing as if it's trying to establish a connection with the dongle to no avail.
Things I noticed:

  1. If you enable USB debugging, go into this broken sleep state, then try to connect the Mi Box to a PC - the PC will report "USB device not recognized" and ADB will show no devices connected. Once you wake the device with the Bluetooth remote and reconnect the USB cable to the PC, the Mi Box is recognized on PC again.
  2. If you enable USB debugging, connect the Mi Box to a PC while the device is awake, you will be able to use the IR remote normally with no issues at all - both going to sleep and waking up work normally until you disconnect the Mi Box from the PC.

@Cr0WD
Copy link

Cr0WD commented Oct 2, 2020

Any solution ?

@arefin932
Copy link

arefin932 commented Oct 2, 2020 via email

@darkkatarsis
Copy link

This is not a solution, if you have a connected USB adapter, you cannot use the ADB Debugger function.

@tpaniaki
Copy link

tpaniaki commented Nov 2, 2021

Same on MiTV-MSSP2 (Android 9) with battery optimisation disabled.

@Xitro01
Copy link

Xitro01 commented Aug 22, 2022

Would love to be able to install it from the store for my Mi TV Box, not a big fan of sideloading stuff. Hopefully someone can help out with this. I'm not a programmer myself, otherwise I would've helped in my spare time.

@ihrapsa
Copy link

ihrapsa commented Aug 22, 2022

Would love to be able to install it from the store for my Mi TV Box, not a big fan of sideloading stuff. Hopefully someone can help out with this. I'm not a programmer myself, otherwise I would've helped in my spare time.

Unfortunately, the app is not working on Mi box anymore (or any other android tv I know of).

@joshuaspence
Copy link

Would love to be able to install it from the store for my Mi TV Box, not a big fan of sideloading stuff. Hopefully someone can help out with this. I'm not a programmer myself, otherwise I would've helped in my spare time.

Unfortunately, the app is not working on Mi box anymore (or any other android tv I know of).

It works for me on the latest version of AndroidTV on a Hitachi device.

@Xitro01
Copy link

Xitro01 commented Aug 22, 2022

Would love to be able to install it from the store for my Mi TV Box, not a big fan of sideloading stuff. Hopefully someone can help out with this. I'm not a programmer myself, otherwise I would've helped in my spare time.

Unfortunately, the app is not working on Mi box anymore (or any other android tv I know of).

That sucks, any alternatives available?

@magicse
Copy link

magicse commented Aug 22, 2022

The alternative is to require an item in the settings menu.
Some developers (for example, Xiaomi) simply blocked this item for no reason.
It is for this reason that I abandoned the Xiaomi Mi box S4 and switched to another manufacturer.

Note. The deep standby mode turning off more STB functions (Google services, messengers, Internet, etc.) and results in longer activation latency.
screen_29
screen_30

@lollilol
Copy link

Any update on this? So far the problem is the notification? Because it's handled differently in Android TV compared to normal Android?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests