Join GitHub today
[Android] add Keep screen awake toggle #4428
continuation of #4409 , which I managed to close somehow, sorry :p
In some phones some runtime configuration changes will force a surfaceDestroyed (followed by surfaceCreate) without losing/regain focus, so we need to refresh the screen on APP_CMD_INIT_WINDOW too. This will help on further "black screen issues"
referenced this pull request
Dec 31, 2018
Updated to use android.setWakelock. Requires koreader/android-luajit-launcher#90
Can be logcated with
01-09 18:19:18.996 26640 26640 V luajit-launcher: Acquiring wakelock 01-09 18:19:32.400 26640 26653 V KOReader: Switching wakelock to false 01-09 18:19:32.400 26640 26653 V luajit-launcher: Releasing wakelock 01-09 18:19:37.600 26640 26640 V luajit-launcher: Releasing wakelock 01-09 18:19:47.609 26640 26653 V KOReader: Switching wakelock to false 01-09 18:19:47.610 26640 26653 V luajit-launcher: Releasing wakelock 01-09 18:19:47.610 26640 26640 V luajit-launcher: Acquiring wakelock 01-09 18:20:09.769 26640 26640 V luajit-launcher: Releasing wakelock 01-09 18:20:13.082 26640 26640 V luajit-launcher: Acquiring wakelock 01-09 18:20:13.083 26640 26653 V KOReader: Switching wakelock to false 01-09 18:20:13.083 26640 26653 V luajit-launcher: Releasing wakelock 01-09 18:20:28.494 26640 26640 V luajit-launcher: Releasing wakelock
Jan 10, 2019
1 check passed
You can help even when the device doesn't refresh at all (once this PR hits nightlies).
You will need adb installed and following the instructions
Also I'm interested in getting a list of vendor/sytem libraries. Which can be done with
@rola25: thanks again.
The good news are that your device is using an "standard" way of updating the screen: via
The bad news are that you need to wait a few weeks/months/years until somebody implements those methods in KOReader.
If you wait a couple of days the log will be more valuable (it will provide your device model) and we can use that model to test further android e-ink aware implementations, since your device is currently unusable with ko.
We cannot run code outside the VM on non rooted devices and even on rooted devices we will break SurfaceFlinger if we try to write directly to the framebuffer a la Linux.
BTW a friend lent me her Energy Pro 4 ereader for a few days. Device is based on RK chipset but hopefully the same logic can be applied to both freescale and rockchip devices. I will see what happens when I have a few spare hours :-)
@Frenzie: thanks for the reminder, AFAICT every open implementation is based on http://forum.xda-developers.com/showthread.php?t=1183173.
I will look at relaunchx first since seems easier to understand: https://github.com/rychly/relaunchx/blob/rychly/master/app/src/main/java/com/gacode/relaunchx/N2EpdController.java
It seems that I've got the worst device to test. Tolino has an ScreenHelper class to handle libepd.so, Nook has the great N2EpdController and onyx devices have a full sdk w/ imx6 & rk3026 targets.
The reader I have just does
So, in short: in order to add full screen eink updates we need to add various epd controllers, a la Coolreader. It is not possible to probe current device epd controller without testing one by one (has a Nook epd?, has a Tolino epd?, has an Onyx epd? is a boyue crap?). This is bad because the ideal solution would be probing epd in the frontend. But instead of this we need to keep lists of "compatible" devices w/ each method and call that method directly.