mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
UIManager: Give more time to the kernel to figure out if we're actually
plugged in...
This commit is contained in:
@@ -1764,14 +1764,14 @@ end
|
||||
-- The common operations that should be performed when the device is plugged to a power source.
|
||||
function UIManager:_beforeCharging()
|
||||
-- Leave the kernel some time to figure it out ;o).
|
||||
self:scheduleIn(0.5, function() Device:setupChargingLED() end)
|
||||
self:scheduleIn(1, function() Device:setupChargingLED() end)
|
||||
self:broadcastEvent(Event:new("Charging"))
|
||||
end
|
||||
|
||||
-- The common operations that should be performed when the device is unplugged from a power source.
|
||||
function UIManager:_afterNotCharging()
|
||||
-- Leave the kernel some time to figure it out ;o).
|
||||
self:scheduleIn(0.5, function() Device:setupChargingLED() end)
|
||||
self:scheduleIn(1, function() Device:setupChargingLED() end)
|
||||
self:broadcastEvent(Event:new("NotCharging"))
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user