-
Notifications
You must be signed in to change notification settings - Fork 100
Add support for the Tolino Shine 4, and a proper light controller for the B300 Tolino devices #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…ls for the B300 Tolinos based off of koreader/pull/520
Forgot to add the Shine 4 in the enum id.
Should Codacy be fixed in this case? https://app.codacy.com/gh/koreader/android-luajit-launcher/pull-requests/570/complexity |
I don't see how you would. ;-) |
My only complaint is whether this is the better way to implement needsInvertedWarmth, import DeviceInfo for lights. Line 25 in 374535d
|
How exactly do you mean by this? I'm not sure how else I would go about implementing it seeing this is basically my first time writing kotlin (and basically my second time writing code in general lol) |
This works, it's just a matter of making the code modular. Some tolino devices are identified using files on device firmware: Line 26 in d676dd6
I don't know if it's better to import DeviceInfo into lights since the implementation is separated for device match, or if it should use an additional driver for the inverted warmth, or maybe try another trick like the Tolino root driver. That's why I asked @pazos to opinate. |
This is a continuation of PR #568, as always, the original light controller code was pulled from PR #520, fixed up to work with the current codebase, as well as adding more things to handle the different properties of the Shine 4 and Vision 6.
Original light controller code credit to dboleslawski. Vision 6 has been personally tested. Thanks to Waldy for testing the Epos 3 and Shine 4 for me. Shine 4 has been confirmed to be fully supported with this commit (Light/E-ink), Epos 3 light controls also work with no issues.
As per those two PRs, same caveats apply.
persist.mode.global
property is0
. This has been the case for the Vision 6 and Epos 3 already, so there shouldn't be any qualms of me adding NGL4 driver support to the Shine 4."Please enable 'Modify system settings' for KOReader in Android settings."
ifWRITE_SETTINGS
permission isn't granted when you try to change the brightness/warmth.Originally, I had tried implementing an intent launch to the correct Settings page if the permission hasn't been granted, however, when I return to KOReader, the app crashes and I feel like fixing that ANR crash would be far outside the scope of this PR, therefore I have decided to settle with just a notification toast warning you about it.
Once this PR goes through, I will open another in the main KOReader repo to update the wiki accordingly, also mentioning the E-ink driver quirk so those with B300 Tolinos can find out why the E-ink controller doesn't refresh their screen.
This change is