Have You Tried Turning TalkBack Off and on Again
A few days ago my phone stopped letting me read it by touch.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
A few days ago my phone stopped letting me read it by touch.
Not the screen reader. The phone. I could still swipe through items, double-tap to activate them, and use every two-, three- and four-finger gesture, but the moment I put one finger on the glass and dragged it across the screen to find something, which is the most basic thing a blind person does with a touch screen, nothing happened. No focus moved. Nothing was spoken. No tick as my finger crossed from one item to the next. The screen reader's event stream showed a TOUCH_INTERACTION_START when my finger landed and a TOUCH_INTERACTION_END when it lifted, and between those two events, where there should have been a stream of hover events telling it what was under my finger, there was nothing.
If you've never used a touch screen reader, it's worth explaining why that matters, because sighted people tend to assume swiping is how we use our phones and touch is an extra. It isn't. Swiping moves you through everything on the screen one item at a time, in whatever order the app's developer built it, which on a busy screen can mean forty or fifty swipes to get from the top to the thing you want at the bottom. Touch exploration is how you learn where things are. It's how you find the send button without swiping through the whole conversation, how you work out the layout of an app you've never used, how you jump to the bottom navigation bar, how you read a screen spatially the way a sighted person glances at it. Take it away and you haven't lost a feature. You've lost the map.
I restarted the screen reader. Nothing. I stopped it and started it again, several times. Nothing. I switched to a different build. Nothing. I turned accessibility off at the settings level, waited, and turned it back on. Nothing. Rebooting the phone fixed it, and some hours later it happened again.
Most people in that position would be stuck, because nobody gives blind users the tools to see what their own device is doing. I'm a developer. I work on Backtalk, the open source TalkBack fork a few of us blind developers have been building to clean up the years of rot Google has left in its own screen reader, and I know my way around adb, logcat and dumpsys. So I went digging, and I found it.
To understand the bug, you need a couple of minutes of how touch exploration works under the hood.
When a screen reader like TalkBack or Backtalk turns on Explore by Touch, the system stops sending your touches directly to apps. Everything goes through a piece of the Android framework called TouchExplorer, which lives inside system_server, the central process that runs most of the operating system. TouchExplorer watches your fingers and decides what you're doing. If you swipe, it hands the gesture to the screen reader. If you double-tap, it tells the screen reader to activate the focused item. If you drag with two fingers, and the screen reader has asked for two-finger passthrough, it passes the drag through to the app so you can scroll. If you put one finger down and move it, it converts that into hover events, a HOVER_ENTER, a stream of HOVER_MOVEs and a HOVER_EXIT, and injects them back into the system, and the screen reader uses those hovers to work out what's under your finger and speak it.
Injected events don't come from the real touchscreen. They come from a virtual device, which on my phone has the id -1. The real touchscreen is device 9. Every event TouchExplorer injects is checked by the input dispatcher, the part of system_server that decides where every touch on the device goes. The dispatcher tracks, per device, which pointers are down and which are hovering, so that it can reject event streams that don't make sense. That's reasonable. You don't want apps receiving a finger that lifts before it touched down.
Here's what dumpsys input showed after the failure:
Touching pointer IDs by device: {DeviceId(-1): {3}} Hovering pointer IDs by device: {} Down times by device: {DeviceId(-1): 35493713000000, DeviceId(9): 25534642174000} TouchStatesByDisplay: <no displays touched>
The first line says the dispatcher believed pointer id 3, on the injection device, was touching the screen. Not a real finger; a fake one that TouchExplorer had put down on my behalf. It went down at 35,493.7 seconds of uptime and never came back up. I checked that dump repeatedly over more than fifty minutes, with no fingers near the screen, and it never changed: same pointer, same device, same down time. The last line, TouchStatesByDisplay: <no displays touched>, is the dispatcher's other bookkeeping agreeing that nothing was touching the display. The two sets of state disagreed, and the one that governed injection was wrong.
A hover can't happen while a pointer is down. You're either touching or hovering. So every time TouchExplorer tried to inject a hover for my exploring finger, the dispatcher looked at device -1, saw a pointer it thought was still pressed, and threw the hover away:
E InputDispatcher: Inconsistent event: MotionEvent { action=HOVER_ENTER, id[0]=0, x[0]=351.738, y[0]=1747.88, eventTime=37892674107000ns, downTime=37876906000000ns, deviceId=-1, source=TOUCHSCREEN, displayId=0, eventId=0xdae08c87}, reason: Injection on 0: Invalid HOVER_ENTER event - pointers are down for device DeviceId(-1): {DeviceId(-1): {3}}
HOVER_ENTER, rejected because pointers are down. HOVER_MOVE, rejected because pointers are down. Then HOVER_EXIT, rejected for the opposite reason, because no pointers were hovering, which they weren't, because the enter had been rejected. The timestamps on that line matter too: the stuck pointer went down at 35,493.7 seconds, and this hover was trying to get through at 37,892.7. Forty minutes later, the dispatcher was still holding on to that finger.
I counted. My first capture had 1,371 of these rejections: 16 HOVER_ENTERs, 16 HOVER_EXITs and the rest HOVER_MOVEs, which is sixteen separate attempts to explore the screen, each thrown away in full. The second capture had 1,425. A third, taken after the log buffer had rolled over and lost the earlier lines, had another 578. Every one of those lines is me dragging a finger across my own phone, trying to read it, and the operating system deciding I wasn't allowed to.
The log has a strong candidate for how the pointer got stuck.
At 18:54:51 there was a single messy multi-finger touch. It started with two fingers, grew to three, four, then five, with fingers added and lifted in no particular order, ACTION_POINTER_DOWN(1), ACTION_POINTER_DOWN(4), ACTION_POINTER_UP(1), ACTION_POINTER_UP(3) and so on, before everything lifted. That's not a deliberate gesture. That's what happens on a big foldable screen when a palm brushes the edge, you shift your grip, or a stray finger lands while you're holding the phone open in one hand. On a Fold, with that much glass, it happens constantly.
For roughly 47 events during that touch, TouchExplorer logged the same error:
E TouchExplorer: mDraggingPointerId doesn't match any pointers on current event. mDraggingPointerId: -1, Event: MotionEvent { action=ACTION_POINTER_UP(3), ... pointerCount=4 ... deviceId=9 ...
That's TouchExplorer saying it was in its dragging state, the state it uses when passing a drag through to an app, but that the pointer it thought it was dragging had an id of -1, which isn't a pointer. It's the "nothing" value. The same error came back in bursts afterwards: 148 events at 19:06:45, more at 19:07:51 and 19:08:51, and at 19:34:42 to 19:34:44 for plain single-finger touches, ending in an ordinary ACTION_UP with the same complaint.
My reading is that TouchExplorer entered the dragging state without a valid pointer to drag, injected a DOWN for one of the extra fingers, and then, when the UP events came, took the early return in the branch that logs "doesn't match any pointers" instead of injecting the matching UP or CANCEL. The dispatcher saw the DOWN, never saw the UP, and held that fake finger down from then on. I said in the report that this was my reading of the log, that I didn't have the framework source for this build to confirm it, and that I hadn't been able to reproduce it on demand. I try not to claim more than I can prove, and that matters most when you're the kind of person a support team might be inclined to dismiss.
This is what turns an irritating bug into a serious one: no app can clear it, and I tried everything an app can do.
Restarting the screen reader doesn't touch it, because the state isn't in the screen reader. It's in system_server. The screen reader process can die and come back as often as you like; the dispatcher doesn't care.
Turning accessibility off doesn't touch it. I set accessibility_enabled to 0 and left it there for four seconds. TouchExplorer stayed in the list of enabled input features on both displays, and pointer 3 stayed stuck.
Injecting a gesture to lift the stuck finger doesn't touch it. I used AccessibilityService.dispatchGesture, the supported way for an accessibility service to perform touches, to inject a gesture with four simultaneous strokes covering pointer ids 0 to 3, so that if the system was going to match anything up, it had every chance. I tried it for 80 milliseconds and for four seconds. Both times the callback returned onCompleted, the system's way of saying the gesture went through, and both times dumpsys input showed the same stuck pointer with the same down time. During the four-second gesture, the dispatcher's verifier showed only the stuck pointer, not mine, which suggests that gestures dispatched this way don't pass through the same state at all, or go out on a different device id. Either way, they can't reach it.
There is no supported call that tells the system to forget injected input state. The screen reader can't fix it. The user can't fix it from settings. Only a reboot clears it, by throwing away all of system_server and starting again, and then you're one stray palm away from it happening again.
It isn't a Backtalk bug. It lives below every screen reader on the device. I've seen it with TalkBack 16, 16.1, 16.2 and 17.0, on Android 15, 16 and 17, and other screen reader users have described the same symptom to me: swipes fine, touch dead, reboot fixes it. Anything that turns on Explore by Touch is exposed to it, which on Android means nearly every blind user who relies on a screen reader.
The subject line told you what was broken and where: touch exploration stops working system-wide because the input dispatcher keeps an injected pointer, device -1, id 3, down after a multi-finger touch, and rejects all later hover events. Then a summary. Then an impact section explaining in plain language that a blind user who can't explore by touch has lost the main way they read a screen, until they reboot.
Then the device and software details: Samsung Galaxy Z Fold7, model SM-F966B, Android 17, SDK 37, One UI 9.0, the full build number, the September security patch. The screen reader, which service, what it was based on, and the exact flags it registered with: requestMultiFingerGestures=true, requestTwoFingerPassthrough=true, serviceHandlesDoubleTap=true, touchExplorationEnabled=true. Confirmation that magnification was off, so nobody would waste time blaming the magnification gesture handler. The full list of enabled input features on the display. Confirmation that only one accessibility service was bound, so nobody would waste time blaming a second service fighting the first.
Then the symptom. Then the dumpsys input output. Then the rejected events with their counts and reasons. Then the TouchExplorer errors around the likely trigger, with timestamps, and every later burst. Then my analysis, labelled as analysis. Then a section headed "What I tried, and what did not clear it", covering restarting the screen reader, switching builds, the four-stroke gestures, disabling accessibility, and the reboot. Then reproduction notes, honest that I couldn't trigger it on demand, with an offer
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。