wakelock-revamp icon indicating copy to clipboard operation
wakelock-revamp copied to clipboard

Compatibility with Android TV

Open Twanislas opened this issue 5 years ago • 33 comments

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: https://github.com/JeffLIrion/python-androidtv/issues/18#issuecomment-478183332

Twanislas avatar Feb 07 '20 22:02 Twanislas

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 :).

d4rken avatar Feb 13 '20 08:02 d4rken

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

bieniu avatar Feb 13 '20 08:02 bieniu

+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.

Twanislas avatar Feb 13 '20 08:02 Twanislas

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

CreaaZ avatar Mar 17 '20 09:03 CreaaZ

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

magicse avatar Apr 16 '20 12:04 magicse

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.

potatoxbe avatar Apr 17 '20 10:04 potatoxbe

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.

keizie avatar Apr 23 '20 10:04 keizie

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.

orholly avatar Apr 24 '20 10:04 orholly

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.

d4rken avatar Apr 24 '20 14:04 d4rken

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.

magicse avatar Apr 24 '20 20:04 magicse

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.

d4rken avatar Apr 24 '20 20:04 d4rken

no any notifications....

magicse avatar Apr 24 '20 20:04 magicse

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

magicse avatar Apr 24 '20 21:04 magicse

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

d4rken avatar Apr 25 '20 16:04 d4rken

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

magicse avatar Apr 25 '20 16:04 magicse

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

d4rken avatar Apr 28 '20 16:04 d4rken

ok

magicse avatar Apr 30 '20 12:04 magicse

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

saarsinai avatar May 17 '20 20:05 saarsinai

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

arefin932 avatar May 18 '20 19:05 arefin932

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

magicse avatar May 21 '20 11:05 magicse

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.

VoyteckPL avatar Jul 24 '20 08:07 VoyteckPL

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

darkkatarsis avatar Aug 29 '20 18:08 darkkatarsis

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.

IgorEisberg avatar Oct 02 '20 14:10 IgorEisberg

Any solution ?

Cr0WD avatar Oct 02 '20 22:10 Cr0WD

I ended us using the following USB ethernet adapter and it works flawlessly. Only a USB adapter with AX88179 chipset works flawlessly with Android TV OS and the uGreen one has AX88179 chipset. Hope it helps.

https://www.amazon.com/dp/B00LLUEJFU

arefin932 avatar Oct 02 '20 22:10 arefin932

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

darkkatarsis avatar Oct 07 '20 16:10 darkkatarsis

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

tpaniaki avatar Nov 02 '21 18:11 tpaniaki

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.

Xitro01 avatar Aug 22 '22 07:08 Xitro01

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).

ihrapsa avatar Aug 22 '22 07:08 ihrapsa

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.

joshuaspence avatar Aug 22 '22 07:08 joshuaspence