Commit Graph

101 Commits (3427c207b0dc8eca0ace1dc25633dd6a76e910ab)

Author SHA1 Message Date
Martín Fernández 3427c207b0
android: bump test activity (#8483)
Now users can test light drivers too. See https://github.com/koreader/android-luajit-launcher/pull/339#issuecomment-977822717
2 years ago
Martín Fdez 6fb52528cd disable light settings on ChromeOS, android TV and e-ink devices without lights 3 years ago
Martín Fdez 8bf19a7327 flush settings before being killed 3 years ago
Martín Fernández ee92ca68e8
workaround for Onyx Poke2 nonsense (#7872)
Requires koreader/android-luajit-launcher#320

Also the luajit-launcher bump adds support for Likebook P78 and sanitizes clipboard text.
3 years ago
Martín Fernández 9f097da4f0
Bump android backend (#7813)
* Bumps the target Sdk to Android 11 (API30)
* Add a crash handler
3 years ago
Frans de Jonge 039947886f
Revert "Hyphenation: add custom hyphenation rules (#7746)" (#7785)
This reverts commit f25da5d0d5.
3 years ago
zwim f25da5d0d5
Hyphenation: add custom hyphenation rules (#7746)
The hyphenation of a word can be changed from its default
by long pressing for 3 seconds and selecting 'Hyphenate'.
These overrides are stored in a per-language file, i.e:
koreader/settings/user-German.hyph.
3 years ago
Martín Fernández b8d658b922
android: minor fixes (#7753)
* Save settings before installing a new APK & after resume. 
* Move Resume/Suspend events to Resume/Pause callbacks
3 years ago
Martín Fdez 23b7bfe0ce move android specific bits outside OTAManager 3 years ago
Martín Fernández 939fcf7f0e
android: avoid downloading the APK again if there's one download in progress + fix signature error (#7657) 3 years ago
Frans de Jonge 310151fac9
Fix typo (#7655)
Follow-up to #7632.
3 years ago
Martín Fernández d303fdf694
android: Prompt for install updates when they're downloaded (#7632) 3 years ago
zwim 3d9ed32458
Android: Send Suspend/Resume Events on STOP/START (#7630)
* ReaderHeader: Refresh it *now* on Resume, instead of just re-scheduling an update if auto-refresh is enabled..
3 years ago
zwim e4c9409f97
[plugin] Add a caching mechanism for CoverImage (#7510) 3 years ago
Martín Fernández 53234fcdc1
add hasSystemFonts device property (#7535)
Add system + user paths to the ReMarkable (has normal linux paths)
3 years ago
NiLuJe 1ac0ad2f1a Android: More input handling tweaks
* Android: Fix #7552 by simply ensuring we drain the input/cmd queue first, simply by scheduling the task to the next tick, instead of locally re-implementing part of the event loop ;). (Requires https://github.com/koreader/koreader-base/pull/1356 for extra safety).
* Android: Clear input state when the window loses focus. (Related to the above fix).

* Bump base:

https://github.com/koreader/koreader-base/pull/1356
https://github.com/koreader/koreader-base/pull/1357

* Bump android-luajit-launcher:

https://github.com/koreader/android-luajit-launcher/pull/293
https://github.com/koreader/android-luajit-launcher/pull/298
https://github.com/koreader/android-luajit-launcher/pull/299
3 years ago
zwim 10922561dd
Add update of the top and bottom status bars, on +/-Charging (#7379) 3 years ago
NiLuJe 6d53f83286
The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415)
* ReaderDictionary: Port delay computations to TimeVal
* ReaderHighlight: Port delay computations to TimeVal
* ReaderView: Port delay computations to TimeVal
* Android: Reset gesture detection state on APP_CMD_TERM_WINDOW.
  This prevents potentially being stuck in bogus gesture states when switching apps.
* GestureDetector:
  * Port delay computations to TimeVal
  * Fixed delay computations to handle time warps (large and negative deltas).
  * Simplified timed callback handling to invalidate timers much earlier, preventing accumulating useless timers that no longer have any chance of ever detecting a gesture.
  * Fixed state clearing to handle the actual effective slots, instead of hard-coding slot 0 & slot 1.
  * Simplified timed callback handling in general, and added support for a timerfd backend for better performance and accuracy.
  * The improved timed callback handling allows us to detect and honor (as much as possible) the three possible clock sources usable by Linux evdev events.
    The only case where synthetic timestamps are used (and that only to handle timed callbacks) is limited to non-timerfd platforms where input events use
    a clock source that is *NOT* MONOTONIC.
    AFAICT, that's pretty much... PocketBook, and that's it?
* Input:
  * Use the <linux/input.h> FFI module instead of re-declaring every constant
  * Fixed (verbose) debug logging of input events to actually translate said constants properly.
  * Completely reset gesture detection state on suspend. This should prevent bogus gesture detection on resume.
  * Refactored the waitEvent loop to make it easier to comprehend (hopefully) and much more efficient.
    Of specific note, it no longer does a crazy select spam every 100µs, instead computing and relying on sane timeouts,
    as afforded by switching the UI event/input loop to the MONOTONIC time base, and the refactored timed callbacks in GestureDetector.
* reMarkable: Stopped enforcing synthetic timestamps on input events, as it should no longer be necessary.
* TimeVal:
  * Refactored and simplified, especially as far as metamethods are concerned (based on <bsd/sys/time.h>).
  * Added a host of new methods to query the various POSIX clock sources, and made :now default to MONOTONIC.
  * Removed the debug guard in __sub, as time going backwards can be a perfectly normal occurrence.
  * New methods:
    * Clock sources: :realtime, :monotonic, :monotonic_coarse, :realtime_coarse, :boottime
    * Utility: :tonumber, :tousecs, :tomsecs, :fromnumber, :isPositive, :isZero
* UIManager:
  * Ported event loop & scheduling to TimeVal, and switched to the MONOTONIC time base.
    This ensures reliable and consistent scheduling, as time is ensured never to go backwards.
  * Added a :getTime() method, that returns a cached TimeVal:now(), updated at the top of every UI frame.
    It's used throughout the codebase to cadge a syscall in circumstances where we are guaranteed that a syscall would return a mostly identical value,
    because very few time has passed.
    The only code left that does live syscalls does it because it's actually necessary for accuracy,
    and the only code left that does that in a REALTIME time base is code that *actually* deals with calendar time (e.g., Statistics).
* DictQuickLookup: Port delay computations to TimeVal
* FootNoteWidget: Port delay computations to TimeVal
* HTMLBoxWidget: Port delay computations to TimeVal
* Notification: Port delay computations to TimeVal
* TextBoxWidget: Port delay computations to TimeVal
* AutoSuspend: Port to TimeVal
* AutoTurn:
  * Fix it so that settings are actually honored.
  * Port to TimeVal
* BackgroundRunner: Port to TimeVal
* Calibre: Port benchmarking code to TimeVal
* BookInfoManager: Removed unnecessary yield in the metadata extraction subprocess now that subprocesses get scheduled properly.

* All in all, these changes reduced the CPU cost of a single tap by a factor of ten (!), and got rid of an insane amount of weird poll/wakeup cycles that must have been hell on CPU schedulers and batteries..
3 years ago
Martín Fernández eb57c4e0da
Add a couple of modern android dicts (#7359)
https://play.google.com/store/apps/details?id=gaurav.lookuppro and its free version.

From https://www.mobileread.com/forums/showpost.php?p=4097548&postcount=8
3 years ago
NiLuJe 183e0a2e25
Bump android-luajit-launcher (#7137)
* Check available width when using a viewport

* Mention that available_width should always match width
3 years ago
NiLuJe 5756f1f43e
LuaJIT on Android fixes (#7094)
* Don't flag Android as should_restrict_JIT

And allow disabling the C blitter, to put the workaround to the test...

* Add a -d, --debug flag to the log function

Catches KOReader's debug, as well as (our) dlopen & luajit logging

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/283
https://github.com/koreader/android-luajit-launcher/pull/282

* Bump base

(https://github.com/koreader/koreader-base/pull/1279)
3 years ago
NiLuJe f1f439d08b
More Android trickery (#7059)
* Modernize jit syntax

It's built-in, no need for a require anymore.

* Flag Android should_restrict_JIT again

It's mildly helpful at putting off the inevitable.
(very, very, very, very mildly).

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/281
3 years ago
NiLuJe d845741b15
Android: Don't mark the platform as should_restrict_JIT (#7024)
* Android: Don't mark the platform as should_restrict_JIT

And see how much stuff breaks \o/

* Prevent Android users from disabling the C blitter, regardless of the
restrict flag

* Update android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/278
https://github.com/koreader/android-luajit-launcher/pull/275
3 years ago
Martín Fernández c481c5aa04
move unpackArchive to Device, use native version on android (#6959) 3 years ago
Martín Fdez be2bcac28e switch between internal and external sdcard 3 years ago
Martín Fernández 4a6f8769ae
android: fix dict overrides (#6887)
- User overrides marked as false were not checked
- Actions without app were skipped.
3 years ago
zwim 926e7dd402
coverimage plugin (#6813)
* Plugin for saving the cover image to file. Useful in some e-ink android devices.
4 years ago
Martín Fernández 91708e25d0
android-luajit-launcher refactor (#6821)
- Lcd devices won't use the SurfaceView, just the good old native content/window (except AndroidTv and ChromeOS)
- All android dialogs will be presented with Material Design on recent devices.
- Added an option to device settings to manage application battery optimization.
- Permissions that require the user to go to a settings page will be presented with a native android dialog.
- bump android-luajit-launcher

- Changes under the hood: koreader/android-luajit-launcher#257
4 years ago
Martín Fernández 99ad13b13c
android: handle onDestroy (#6811)
* handle onDestroy

we need it if killed by the system (ie: battery optimizations or OOM)
we need it to exit the lua VM when we call finish() from Kotlin

This prevents us for being trapped into a zombie state
4 years ago
Martín Fdez 009e2b3b94 android: reinit FM after surface change 4 years ago
NiLuJe e169b34577
Fancier Wi-Fi status icons in ReaderFooter (#6725)
* In icons mode, just use two different icons to display Wi-Fi status

* Enable Wi-Fi status icon on Kobo & Cervantes, too

* Refresh footer on (dis)connect if the Wi-Fi status item is enabled
4 years ago
Martín Fernández 27fe0d7957
add eudic from gplay (#6682) 4 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
zwim 2c1d87a956 resolve ANR on hold and native light dialog 4 years ago
zwim 6fb2a0469b
update statusline after native light dialog (#6584) 4 years ago
Martín Fernández c7f77de72a
refactor thirdparty app integration (#6513)
* refactor thirdparty app integration
* Fix fora package name
4 years ago
Martín Fdez 9037a1f4f2 bump luajit-launcher and remove frontlightwidget leftovers 4 years ago
zwim a6763465b4
[Android]: Native light dialog (#6426)
* Adds support for Tolino Epos 2 warmth light
4 years ago
Martín Fdez 8324154177 keep newlines outside translations 4 years ago
Martín Fdez 7094519e1b android: support for native surface rotation 4 years ago
zwim 43693c9fe9
Add the possibility run shell scripts from filemanager on android (#6288) 4 years ago
Martín Fernández 2e731dd4dd
[chore] Device abstraction (#6280)
* generic Device:info() function which returns the model

* add Device:canSuspend() and make it true in all devices that have suspend routines and the emulator

* also enable fake poweroff/reboot on the emulator

* add Device.home_dir

* add Device:hasExitOptions() and update menus & comments
4 years ago
Martín Fernández 765b35a7bf
android: add a toggle to ignore back button events (#6269)
Requires koreader/android-luajit-launcher#233
Requires koreader/koreader-base#1117

It is a workaround for #6263 but can be useful on some devices with erratic back key behaviour too (yep, Onyx)
4 years ago
Martín Fdez 835f9f62c6 fix ANRs in Kosync plugin login/register 4 years ago
Martín Fdez 48727a984b android: add a toggle to force haptic feedback in spite of system settings 4 years ago
Martín Fernández 3856f04445 android: switch to connectivity manager
Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
Martín Fernández 5ef329c19c android: share text (#5745) 4 years ago
Martín Fernández 419b42cf2c
android: call EPD test from within KOReader (#5737)
* android: call EPD test from within KOReader

Co-Authored-By: Frans de Jonge <fransdejonge@gmail.com>
4 years ago
poire-z 0599c440cc [RTL UI] Bidi-wrap filenames, paths, urls, metadata
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
  as using LTR isolates seems uneeded when already LTR" (part
  of a628714f) which was a wrong assumption: we need proper
  wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
  trailing \n.

- Wrap all paths, directories, filenames in the code with
  these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
  as it helps fixing some edge cases (like open/close quotation
  marks which are not considered as bracket types by FriBiDi).
  (Needed some minor logic changes in CoverBrowser.)

- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
  following the recent addition of the page_gap_height option.
4 years ago
Martín Fernández 25e80358dc android: import files from Storage Access Framework 4 years ago