mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Merge pull request #1861 from NiLuJe/master
Some more Kindle 5.7 fixes...
This commit is contained in:
@@ -81,6 +81,10 @@ function Device:intoScreenSaver()
|
||||
if self.charging_mode == false and self.screen_saver_mode == false then
|
||||
self.screen:saveCurrentBB()
|
||||
self.screen_saver_mode = true
|
||||
-- On FW >= 5.7.2, we sigstop awesome, but we need it to show stuff...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
os.execute("killall -cont awesome")
|
||||
end
|
||||
end
|
||||
UIManager:sendEvent(Event:new("FlushSettings"))
|
||||
end
|
||||
@@ -88,11 +92,19 @@ end
|
||||
-- ONLY used for Kindle devices
|
||||
function Device:outofScreenSaver()
|
||||
if self.screen_saver_mode == true and self.charging_mode == false then
|
||||
-- On FW >= 5.7.2, put awesome to sleep again...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
os.execute("killall -stop awesome")
|
||||
end
|
||||
-- wait for native system update screen before we recover saved
|
||||
-- Blitbuffer.
|
||||
util.usleep(1500000)
|
||||
self.screen:restoreFromSavedBB()
|
||||
self:resume()
|
||||
if self:needsScreenRefreshAfterResume() then
|
||||
self.screen:refreshFull()
|
||||
end
|
||||
self.powerd:refreshCapacity()
|
||||
end
|
||||
self.screen_saver_mode = false
|
||||
end
|
||||
@@ -140,14 +152,25 @@ function Device:resume() end
|
||||
function Device:usbPlugIn()
|
||||
if self.charging_mode == false and self.screen_saver_mode == false then
|
||||
self.screen:saveCurrentBB()
|
||||
-- On FW >= 5.7.2, we sigstop awesome, but we need it to show stuff...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
os.execute("killall -cont awesome")
|
||||
end
|
||||
end
|
||||
self.charging_mode = true
|
||||
end
|
||||
|
||||
function Device:usbPlugOut()
|
||||
if self.charging_mode == true and self.screen_saver_mode == false then
|
||||
-- On FW >= 5.7.2, put awesome to sleep again...
|
||||
if os.getenv("AWESOME_STOPPED") == "yes" then
|
||||
os.execute("killall -stop awesome")
|
||||
end
|
||||
-- Same as when going out of screensaver, wait for the native system
|
||||
util.usleep(1500000)
|
||||
self.screen:restoreFromSavedBB()
|
||||
self.screen:refreshFull()
|
||||
self.powerd:refreshCapacity()
|
||||
end
|
||||
|
||||
--@TODO signal filemanager for file changes 13.06 2012 (houqp)
|
||||
|
||||
@@ -41,9 +41,10 @@ if [ "${INIT_TYPE}" == "upstart" ] ; then
|
||||
fi
|
||||
|
||||
# Keep track of what we do with pillow...
|
||||
AWESOME_STOPPED="no"
|
||||
export AWESOME_STOPPED="no"
|
||||
PILLOW_HARD_DISABLED="no"
|
||||
PILLOW_SOFT_DISABLED="no"
|
||||
PASSCODE_DISABLED="no"
|
||||
|
||||
# Keep track of if we were started through KUAL
|
||||
FROM_KUAL="no"
|
||||
@@ -166,6 +167,14 @@ if [ -d /mnt/us/linkfonts/fonts ] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# check if we need to disable the system passcode, because it messes with us in fun and interesting (and, more to the point, intractable) ways...
|
||||
# NOTE: The most egregious one being that it inhibits the outOfScreenSaver event on wakeup until the passcode is validated, which we can't do, since we capture all input...
|
||||
if [ -f "/var/local/system/userpasswdenabled" ] ; then
|
||||
logmsg "Disabling system passcode . . ."
|
||||
rm -f "/var/local/system/userpasswdenabled"
|
||||
PASSCODE_DISABLED="yes"
|
||||
fi
|
||||
|
||||
# check if we are supposed to shut down the Amazon framework
|
||||
if [ "${STOP_FRAMEWORK}" == "yes" ] ; then
|
||||
logmsg "Stopping the framework . . ."
|
||||
@@ -297,9 +306,9 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then
|
||||
# NOTE: Try to leave the user with a slightly more useful FB content than our own last screen...
|
||||
cat /var/tmp/koreader-fb.dump > /dev/fb0
|
||||
rm -f /var/tmp/koreader-fb.dump
|
||||
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home
|
||||
# NOTE: In case we ever need an extra full flash refresh...
|
||||
#eips -s w=${SCREEN_X_RES},h=${SCREEN_Y_RES} -f
|
||||
lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home
|
||||
fi
|
||||
if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then
|
||||
logmsg "Restoring the status bar . . ."
|
||||
@@ -315,3 +324,8 @@ if [ "${INIT_TYPE}" == "upstart" -o "$(uname -r)" == "2.6.31-rt11-lab126" ] ; th
|
||||
iptables -D INPUT -i wlan0 -p tcp --dport 49152:49162 -j ACCEPT
|
||||
fi
|
||||
|
||||
if [ "${PASSCODE_DISABLED}" == "yes" ] ; then
|
||||
logmsg "Restoring system passcode . . ."
|
||||
touch "/var/local/system/userpasswdenabled"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user