From 144706654d5d4616cf1d00b41430e9a44716b720 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Fri, 30 Dec 2022 23:26:56 +0100 Subject: [PATCH] Device: Drop unused device capabilities --- frontend/device/generic/device.lua | 5 +---- frontend/device/kindle/device.lua | 2 -- reader.lua | 7 ------- spec/unit/device_spec.lua | 2 -- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/frontend/device/generic/device.lua b/frontend/device/generic/device.lua index b140d042f..009ff00ae 100644 --- a/frontend/device/generic/device.lua +++ b/frontend/device/generic/device.lua @@ -17,13 +17,11 @@ local function no() return false end local Device = { screen_saver_mode = false, - charging_mode = false, - survive_screen_saver = false, + screen_saver_lock = false, is_cover_closed = false, model = nil, powerd = nil, screen = nil, - screen_dpi_override = nil, input = nil, home_dir = nil, -- For Kobo, wait at least 15 seconds before calling suspend script. Otherwise, suspend might @@ -47,7 +45,6 @@ local Device = { hasNaturalLight = no, -- FL warmth implementation specific to NTX boards (Kobo, Cervantes) hasNaturalLightMixer = no, -- Same, but only found on newer boards hasNaturalLightApi = no, - needsTouchScreenProbe = no, hasClipboard = yes, -- generic internal clipboard on all devices hasEinkScreen = yes, hasExternalSD = no, -- or other storage volume that cannot be accessed using the File Manager diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua index 5a1aec985..8d9f7c7f0 100644 --- a/frontend/device/kindle/device.lua +++ b/frontend/device/kindle/device.lua @@ -283,7 +283,6 @@ function Kindle:usbPlugIn() -- shooting themselves in the foot (c.f., https://github.com/koreader/koreader/issues/3220)! -- On the upside, we don't have to bother waking up the WM to show us the USBMS screen :D. -- NOTE: If the device is put in USBNet mode before we even start, everything's peachy, though :). - self.charging_mode = true end function Kindle:intoScreenSaver() @@ -365,7 +364,6 @@ end function Kindle:usbPlugOut() -- NOTE: See usbPlugIn(), we don't have anything fancy to do here either. - self.charging_mode = false end function Kindle:wakeupFromSuspend() diff --git a/reader.lua b/reader.lua index d7b0c4dc3..cfa4cb4c2 100755 --- a/reader.lua +++ b/reader.lua @@ -188,13 +188,6 @@ CanvasContext:init(Device) -- Handle one time migration stuff (settings, deprecation, ...) in case of an upgrade... require("ui/data/onetime_migration") --- Touch screen (this may display some widget, on first install on Kobo Touch, --- so have it done after CanvasContext:init() but before Bidi.setup() to not --- have mirroring mess x/y probing). -if Device:needsTouchScreenProbe() then - Device:touchScreenProbe() -end - -- UI mirroring for RTL languages, and text shaping configuration local Bidi = require("ui/bidi") Bidi.setup(lang_locale) diff --git a/spec/unit/device_spec.lua b/spec/unit/device_spec.lua index c9c423960..7302ee4f5 100644 --- a/spec/unit/device_spec.lua +++ b/spec/unit/device_spec.lua @@ -91,7 +91,6 @@ describe("device module", function() local Screen = kobo_dev.screen assert.is.same("Kobo_trilogy_C", kobo_dev.model) - assert.falsy(kobo_dev:needsTouchScreenProbe()) local x, y = Screen:getWidth()-5, 10 -- mirror x, then switch_xy local ev_x = { @@ -140,7 +139,6 @@ describe("device module", function() local Screen = kobo_dev.screen assert.is.same("Kobo_trilogy_C", kobo_dev.model) - assert.falsy(kobo_dev:needsTouchScreenProbe()) local x, y = Screen:getWidth()-5, 10 local ev_x = { type = C.EV_ABS,