Legacy Kindle: Unbreak screensavers (#7112)

* The K2 & DXg cannot be SO, so, bypass the check there

* Handle native screensavers on FW 3.x & 4.x
reviewable/pr7113/r1
NiLuJe 3 years ago committed by GitHub
parent eb66856d81
commit 5ae5c99197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -58,6 +58,7 @@ end
--[[ --[[
Test if a kindle device has Special Offers Test if a kindle device has Special Offers
FIXME: Find a way to probe for SO status on FW < 5.x
--]] --]]
local function isSpecialOffers() local function isSpecialOffers()
-- Look at the current blanket modules to see if the SO screensavers are enabled... -- Look at the current blanket modules to see if the SO screensavers are enabled...
@ -201,7 +202,9 @@ function Kindle:intoScreenSaver()
else else
-- Let the native system handle screensavers on SO devices... -- Let the native system handle screensavers on SO devices...
if os.getenv("AWESOME_STOPPED") == "yes" then if os.getenv("AWESOME_STOPPED") == "yes" then
os.execute("killall -cont awesome") os.execute("killall -CONT awesome")
elseif os.getenv("CVM_STOPPED") == "yes" then
os.execute("killall -CONT cvm")
end end
end end
end end
@ -224,7 +227,9 @@ function Kindle:outofScreenSaver()
else else
-- Stop awesome again if need be... -- Stop awesome again if need be...
if os.getenv("AWESOME_STOPPED") == "yes" then if os.getenv("AWESOME_STOPPED") == "yes" then
os.execute("killall -stop awesome") os.execute("killall -STOP awesome")
elseif os.getenv("CVM_STOPPED") == "yes" then
os.execute("killall -STOP cvm")
end end
local UIManager = require("ui/uimanager") local UIManager = require("ui/uimanager")
-- NOTE: We redraw after a slightly longer delay to take care of the potentially dynamic ad screen... -- NOTE: We redraw after a slightly longer delay to take care of the potentially dynamic ad screen...
@ -266,6 +271,7 @@ local Kindle2 = Kindle:new{
canHWInvert = no, canHWInvert = no,
canUseCBB = no, -- 4bpp canUseCBB = no, -- 4bpp
canUseWAL = no, -- Kernel too old to support mmap'ed I/O on /mnt/us canUseWAL = no, -- Kernel too old to support mmap'ed I/O on /mnt/us
supportsScreensaver = yes, -- The first ad-supported device was the K3
} }
local KindleDXG = Kindle:new{ local KindleDXG = Kindle:new{
@ -276,6 +282,7 @@ local KindleDXG = Kindle:new{
canHWInvert = no, canHWInvert = no,
canUseCBB = no, -- 4bpp canUseCBB = no, -- 4bpp
canUseWAL = no, -- Kernel too old to support mmap'ed I/O on /mnt/us canUseWAL = no, -- Kernel too old to support mmap'ed I/O on /mnt/us
supportsScreensaver = yes, -- The first ad-supported device was the K3
} }
local Kindle3 = Kindle:new{ local Kindle3 = Kindle:new{
@ -285,6 +292,7 @@ local Kindle3 = Kindle:new{
hasDPad = yes, hasDPad = yes,
canHWInvert = no, canHWInvert = no,
canUseCBB = no, -- 4bpp canUseCBB = no, -- 4bpp
supportsScreensaver = no, -- Can't probe for SO status on FW < 5.x
} }
local Kindle4 = Kindle:new{ local Kindle4 = Kindle:new{
@ -294,6 +302,7 @@ local Kindle4 = Kindle:new{
canHWInvert = no, canHWInvert = no,
-- NOTE: It could *technically* use the C BB, as it's running @ 8bpp, but it's expecting an inverted palette... -- NOTE: It could *technically* use the C BB, as it's running @ 8bpp, but it's expecting an inverted palette...
canUseCBB = no, canUseCBB = no,
supportsScreensaver = no, -- Can't probe for SO status on FW < 5.x
} }
local KindleTouch = Kindle:new{ local KindleTouch = Kindle:new{
@ -802,7 +811,7 @@ function KindleTouch:exit()
if self.isSpecialOffers then if self.isSpecialOffers then
-- Wakey wakey... -- Wakey wakey...
if os.getenv("AWESOME_STOPPED") == "yes" then if os.getenv("AWESOME_STOPPED") == "yes" then
os.execute("killall -cont awesome") os.execute("killall -CONT awesome")
end end
-- fake a touch event -- fake a touch event
if self.touch_dev then if self.touch_dev then

@ -57,6 +57,7 @@ fi
# Keep track of what we do with pillow... # Keep track of what we do with pillow...
export AWESOME_STOPPED="no" export AWESOME_STOPPED="no"
export CVM_STOPPED="no"
export VOLUMD_STOPPED="no" export VOLUMD_STOPPED="no"
PILLOW_HARD_DISABLED="no" PILLOW_HARD_DISABLED="no"
PILLOW_SOFT_DISABLED="no" PILLOW_SOFT_DISABLED="no"
@ -282,6 +283,7 @@ fi
if [ "${STOP_FRAMEWORK}" = "no" ] && [ "${INIT_TYPE}" = "sysv" ]; then if [ "${STOP_FRAMEWORK}" = "no" ] && [ "${INIT_TYPE}" = "sysv" ]; then
logmsg "Stopping cvm . . ." logmsg "Stopping cvm . . ."
killall -STOP cvm killall -STOP cvm
CVM_STOPPED="yes"
fi fi
# SIGSTOP volumd, to inhibit USBMS (sysv & upstart) # SIGSTOP volumd, to inhibit USBMS (sysv & upstart)

Loading…
Cancel
Save