Minor Input:inhibitInput followup to #9065 (#9139)

* GestureDetector: Downgrade probeClockSource log messages to debug

We're seeing a bit more of 'em between autostandby and inhibitInput now,
and the whole thing was implemented long enough ago that it's no longer
critical to see this in random non-debug logs ;).

* Input: Reset gesture state in inhibitInput

Should prevent bogus gestures when re-enabling the handlers if we were
called in the middle of gesture detection.
pull/9144/head
NiLuJe 2 years ago committed by GitHub
parent 6804b77251
commit e1ac3c4853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -347,7 +347,7 @@ function GestureDetector:probeClockSource(timev)
-- clock-threshold <= timev <= clock+threshold
if timev >= realtime - threshold and timev <= realtime + threshold then
self.clock_id = C.CLOCK_REALTIME
logger.info("GestureDetector:probeClockSource: Touch event timestamps appear to use CLOCK_REALTIME")
logger.dbg("GestureDetector:probeClockSource: Touch event timestamps appear to use CLOCK_REALTIME")
return
end
@ -355,7 +355,7 @@ function GestureDetector:probeClockSource(timev)
local monotonic = time.monotonic_coarse()
if timev >= monotonic - threshold and timev <= monotonic + threshold then
self.clock_id = C.CLOCK_MONOTONIC
logger.info("GestureDetector:probeClockSource: Touch event timestamps appear to use CLOCK_MONOTONIC")
logger.dbg("GestureDetector:probeClockSource: Touch event timestamps appear to use CLOCK_MONOTONIC")
return
end
@ -364,13 +364,13 @@ function GestureDetector:probeClockSource(timev)
-- NOTE: It was implemented in Linux 2.6.39, so, reject 0, which would mean it's unsupported...
if not boottime == 0 and timev >= boottime - threshold and timev <= boottime + threshold then
self.clock_id = C.CLOCK_BOOTTIME
logger.info("GestureDetector:probeClockSource: Touch event timestamps appear to use CLOCK_BOOTTIME")
logger.dbg("GestureDetector:probeClockSource: Touch event timestamps appear to use CLOCK_BOOTTIME")
return
end
-- If we're here, the detection was inconclusive :/
self.clock_id = -1
logger.info("GestureDetector:probeClockSource: Touch event clock source detection was inconclusive")
logger.dbg("GestureDetector:probeClockSource: Touch event clock source detection was inconclusive")
-- Print all all the gory details in debug mode when this happens...
logger.dbg("Input frame :", time.format_time(timev))
logger.dbg("CLOCK_REALTIME :", time.format_time(realtime))

@ -1310,6 +1310,9 @@ function Input:inhibitInput(toggle)
self._generic_ev_handler = self.handleGenericEv
self.handleGenericEv = self.voidEv
end
-- Reset gesture detection state to a blank slate, to avoid bogus gesture detection on restore.
self:resetState()
else
-- Restore event handlers, if any
if self._key_ev_handler then

@ -1743,9 +1743,6 @@ function UIManager:_beforeSuspend()
-- Disable key repeat to avoid useless chatter (especially where Sleep Covers are concerned...)
Device:disableKeyRepeat()
-- Reset gesture detection state to a blank slate (anything power-management related emits KEY events, which don't need gesture detection).
Input:resetState()
end
-- The common operations that should be performed after resuming the device.

Loading…
Cancel
Save