Android input 系统InputReader,InputDispatcher线程实例--UI死掉

当Android设备开机时,如果在加载动画期间连续触摸屏幕,可能会出现UI无响应但触控报点正常的情况。这涉及到InputReader和InputDispatcher线程。问题在于touch firmware,当压力参数未正确上报时,会导致UI不响应。多点触摸有时能暂时恢复UI,但释放手指后又恢复原状。解决方法是更换正常的touch firmware,避免在压力阈值和多点触摸情况上的错误限定。
摘要由CSDN通过智能技术生成

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值