Android input 系统InputReader,InputDispatcher线程实例–UI死掉但touch 正常报点
依据 Android input 系统初始化和启动流程中的背景:
做Android touch 驱动时,设备在开机的时加载动画(kernel 层已load OK),若用手连续点击屏幕,待完全设备开机后UI 没有反应,但是touch依然正常报点,多点触摸时会临时恢复,但finger release 后依然恢复原样(UI没反应)。但getevent实际发现此时touch可以正常报点。
1.结合:Android input 系统之一:InputReader线程 和Android input 系统之二:InputDispatcher线程:
得知:在开机的时加载动画(kernel 层已load OK),若用手连续点击屏幕,待完全设备开机后UI 没有反应的原因在此段代码发现的问题:
void MultiTouchInputMapper::process
bool TouchButtonAccumulator::isHovering()
void MultiTouchInputMapper::process
void MultiTouchInputMapper::syncTouch(nsecs_t when, RawState* outState)
2.对比NG和OK的logs
NG logs
12-07 09:27:17.185 505 620 V EventHub: /dev/input/event2 got: time=71.191970, type=3, code=53, value=203
12-07 09:27:17.185 505 620 V EventHub: event time 71191970000, now 71192036233
12-07 09:27:17.185 505 620 V EventHub: /dev/input/event2 got: time=71.191970, type=0, code=0, value=0
12-07 09:27:17.186 505 620 V EventHub: event time 71191970000, now 71192036233
12-07 09:27:17.186 505 620 E InputReader: BatchSize: 2 Count: 2
12-07 09:27:17.186 505 620 E InputReader: Input event: device=4 type=0x0003 code=0x0035 value=0x000000cb when=71191970000
12-07 09:27:17.186 505 620 E InputReader: Input event: device=4 type=0x0000 code=0x0000 value=0x00000000 when=71191970000
12-07 09:27:17.186 505 620 E InputReader: Reader 6734 Line jeet add track touch outPointer.pressure= 0
12-07 09:27:17.186 505 620 E InputReader: jeet add log mHaveBtnTouch=1,mBtnTouch=1
12-07 09:27:17.186 505 620 E InputReader: Reader 6756 Line jeet add track touch isHovering= 1
12-07 09:27:17.186 505 620 E InputReader: Reader 6734 Line jeet add track touch outPointer.isHovering= 1
12-07 09:27:17.186 505 620 E InputReader: syncTouch: pointerCount 1 -> 1, touching ids 0x00000000 -> 0x00000000, hovering ids 0x80000000 -> 0x80000000
12-07 09:27:17.186 505 620 E InputReader: Reader 4821 LINE jeet liu track touch pressure switch=2
12-07 09:27:17.186 505 620 E InputReader: Reader 4824 LINE jeet liu track touch pressure case PHYSICAL
12-07 09:27:17.186 505 620 E InputReader: Reader 4827 LINE jeet liu track touch pressure calibration mPressureScale=0.003922
12-07 09:27:17.186 505 620 E InputReader: Reader 4828 LINE jeet liu track touch pressure calibration pressure=0.000000
12-07 09:27:17.186 505 620 E InputReader: Reader 4829 LINE jeet liu track touch pressure calibration in.pressure= 0
12-07 09:27:17.187 505 620 E InputReader: Reader 4835 LINE jeet liu track touch pressure calibration in.isHovering= 1
OK logs
12-07 09:47:41.214 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=3, code=57, value=0
12-07 09:47:41.214 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.214 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=3, code=58, value=50
12-07 09:47:41.214 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.214 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=3, code=48, value=6
12-07 09:47:41.214 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.214 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=3, code=53, value=346
12-07 09:47:41.214 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.215 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=3, code=54, value=770
12-07 09:47:41.215 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.215 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=1, code=330, value=1
12-07 09:47:41.215 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.215 496 615 V EventHub: /dev/input/event2 got: time=732.217009, type=0, code=0, value=0
12-07 09:47:41.215 496 615 V EventHub: event time 732217009000, now 732217094658
12-07 09:47:41.215 496 615 E InputReader: BatchSize: 7 Count: 7
12-07 09:47:41.215 496 615 E InputReader: Input event: device=4 type=0x0003 code=0x0039 value=0x00000000 when=732217009000
12-07 09:47:41.215 496 615 E InputReader: Input event: device=4 type=0x0003 code=0x003a value=0x00000032 when=732217009000
12