Skip to content
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

Tolino Shine 4 support #457

Closed
wants to merge 12 commits into from
9 changes: 9 additions & 0 deletions app/src/main/java/org/koreader/launcher/device/DeviceInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ object DeviceInfo {
TAGUS_GEA,
TOLINO_EPOS,
TOLINO_SHINE3,
TOLINO_SHINE4,
TOLINO_VISION4,
TOLINO_VISION5
}
Expand Down Expand Up @@ -230,6 +231,7 @@ object DeviceInfo {
private val TAGUS_GEA: Boolean
private val TOLINO_EPOS: Boolean
private val TOLINO_SHINE3: Boolean
private val TOLINO_SHINE4: Boolean
private val TOLINO_VISION4: Boolean
private val TOLINO_VISION5: Boolean

Expand Down Expand Up @@ -547,6 +549,12 @@ object DeviceInfo {
&& DEVICE.contentEquals("ntx_6sl")
&& HARDWARE.contentEquals("e60k00")

// Tolino Shine 4 also has warmth lights, but with ntx_io file
TOLINO_SHINE4 = BRAND.contentEquals("rakutenkobo")
&& MODEL.contentEquals("tolino shine 4")
&& DEVICE.contentEquals("tolino")
&& HARDWARE.contentEquals("sun8iw15p1")

// Tolino Vision 4 also has warmth lights, but with ntx_io file
TOLINO_VISION4 = BRAND.contentEquals("rakutenkobo")
&& MODEL.contentEquals("tolino")
Expand Down Expand Up @@ -697,6 +705,7 @@ object DeviceInfo {
lightsMap[LightsDevice.TAGUS_GEA] = TAGUS_GEA
lightsMap[LightsDevice.TOLINO_EPOS] = TOLINO_EPOS
lightsMap[LightsDevice.TOLINO_SHINE3] = TOLINO_SHINE3
lightsMap[LightsDevice.TOLINO_SHINE4] = TOLINO_SHINE4
lightsMap[LightsDevice.TOLINO_VISION4] = TOLINO_VISION4
lightsMap[LightsDevice.TOLINO_VISION5] = TOLINO_VISION5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ object LightsFactory {
val lightsController: LightsInterface
get() {
return when (DeviceInfo.LIGHTS) {
DeviceInfo.LightsDevice.TOLINO_EPOS -> {
DeviceInfo.LightsDevice.TOLINO_EPOS,
DeviceInfo.LightsDevice.TOLINO_SHINE4 -> {
logController("TolinoRoot")
TolinoRootController()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ class TolinoRootController : LightsInterface {
private const val MIN = 0
private const val ACTUAL_BRIGHTNESS_FILE = "/sys/class/backlight/mxc_msp430_fl.0/actual_brightness" // always readable, same for Epos2 and Vision4
private const val COLOR_FILE_EPOS2 = "/sys/class/backlight/tlc5947_bl/color"
private const val COLOR_FILE_SHINE4 = "/sys/class/leds/aw99703-bl_FL1/color"
private const val COLOR_FILE_VISION4HD = "/sys/class/backlight/lm3630a_led/color"
private val COLOR_FILE = if (File(COLOR_FILE_VISION4HD).exists())
private val COLOR_FILE = if (File(COLOR_FILE_SHINE4).exists())
COLOR_FILE_SHINE4
else if (File(COLOR_FILE_VISION4HD).exists())
COLOR_FILE_VISION4HD
else
COLOR_FILE_EPOS2
Expand Down