您的位置:首页 > 游戏 > 手游 > 泉州关键词网站排名_长沙seo排名扣费_温州网站快速排名_网站发布与推广方案

泉州关键词网站排名_长沙seo排名扣费_温州网站快速排名_网站发布与推广方案

2025/5/9 1:58:28 来源:https://blog.csdn.net/abc6368765/article/details/146610483  浏览:    关键词:泉州关键词网站排名_长沙seo排名扣费_温州网站快速排名_网站发布与推广方案
泉州关键词网站排名_长沙seo排名扣费_温州网站快速排名_网站发布与推广方案

前言

系统开发过程中经常会遇到冻屏问题,所谓的冻屏问题就是指屏幕内容看起来一切正常,但是却触控无效、画面卡住、按键无反应,但系统可能仍在后台运行(如触控无效、画面卡住、按键无反应),这种问题有很多方面的原因:

  • 硬件故障 触控屏、显示控制器或内存硬件故障
  • GPU/显示驱动问题 GPU 渲染超时、驱动崩溃或帧缓冲区(FrameBuffer)错误
  • SurfaceFlinger 异常 图形合成服务(SurfaceFlinger)崩溃或死锁
  • 主线程阻塞 Activity/View 主线程执行耗时操作(如 I/O、死循环)
  • 输入系统故障 InputDispatcher 事件分发阻塞(如焦点窗口丢失、ANR)
  • 系统服务死锁 WindowManagerService/ActivityManager 等核心服务线程阻塞

本篇文章由于是输入系统系列的文章,所以我们不考虑其他场景,主要考虑当冻屏问题是因为输入系统故障而导致的,这个时候我们要如何层层剥茧,最终定位出输入系统故障具体原因。

设备节点是否正常

adb指令getevent的实现原理就是直接挂载dev/input/eventx事件节点,然后当这些事件节点有事件上报的时候将其打印出来。
因此当发生触摸异常问题的时候,我们可以通过这个指令可以将触摸异常的事件原因一分为二:

设备节点没有收到没有收到触摸事件

如果getevent都没有打印输入事件,则说明驱动层存在异常,事件直接没有上报,需要驱动层的相关人员进行问题的进一步分析

设备节点有收到没有收到触摸事件

正常情况下当我们触摸屏幕的时候,getevent会打印类似下面的日志信息,这就说明驱动层没有问题,需要我们做进一步分析
在这里插入图片描述

InputReader是否正常

可以在Android开发者选项中开启【显示触摸操作】,然后当手指在屏幕按下的时候,确认屏幕上是否会出现一个触摸反馈小圆点。
显示触摸操作

触摸反馈小圆点的实现原理主要是通过监听Input模块的InputReader是否有收到输入事件加工,如果触摸事件小圆点能正常显示,则说明InputReader大概率是正常的;反之则需要在InputReader模块添加相关日志信息进行问题排查。

InputDispatcher是否正常

可以在Android开发者选项中开启【指针位置】,然后当手指在屏幕按下滑动的时候,确认屏幕上是否会出现一系列线条轨迹。
在这里插入图片描述

触摸轨迹的实现原理主要是通过监听Input模块的InputDispatcher是否有收到输入事件分发,如果屏幕上能够正常出现一系列线条轨迹,则说明InputDispatcher大概率是正常的;反之则需要在InputDispatcher模块添加相关日志信息进行问题排查。

Input的堆栈信息是否正常

当我们手势按压在屏幕上行,然后输入dumpsys input指令,一般会得到类似下面的信息。

INPUT MANAGER (dumpsys input)Input properties:persist.input.velocitytracker.strategy = default//输入服务的状态
Input Manager State:Interactive: true	//表示设备处于互动模式,可以接受用户输入。System UI Lights Out: false	//系统 UI 没有进入熄灯模式。Pointer Speed: 0	//指针速度设置为 0,通常意味着没有加速或者速度控制。Pointer Acceleration: 3.000	//指针加速设置为 3,这可能影响触摸输入的速度和灵敏度。Pointer Gestures Enabled: true	//表示指针手势(如多点触摸、滑动等)已启用。Show Touches: true	//开启【显示触摸位置】开发者选项Pointer Capture: Disabled, seq=0	//指针捕获功能禁用,意味着没有一个输入设备会独占指针。//输入相关的设备信息
Event Hub State:BuiltInKeyboardId: 4Devices:1: ACCDET	//耳机插入检测Classes: KEYBOARD | SWITCH	//类型是键盘和开关Path: /dev/input/event0	//设备挂载路径Enabled: true	//可用状态Descriptor: 1c78f7e0d16d4dbc8d3ab93943523f379203f90bLocation: ControllerNumber: 0UniqueId: Identifier: bus=0x0019, vendor=0x0000, product=0x0000, version=0x0000KeyLayoutFile: /system/usr/keylayout/ACCDET.klKeyCharacterMapFile: /system/usr/keychars/Generic.kcmConfigurationFile: VideoDevice: <none>2: touchpanel //触摸面板Classes: KEYBOARD | TOUCH | TOUCH_MT	//类型是键盘、触摸和多点触控Path: /dev/input/event2	//设备挂载路径Enabled: true	//可用状态Descriptor: cda32dd32c9e529b964f707ef746a9e34b2b074fLocation: ControllerNumber: 0UniqueId: Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000KeyLayoutFile: /system/usr/keylayout/Generic.klKeyCharacterMapFile: /system/usr/keychars/Generic.kcmConfigurationFile: VideoDevice: <none>4: qwerty (aka device 0 - built-in keyboard)	//内建键盘Classes: KEYBOARDPath: /dev/input/event4Enabled: trueDescriptor: 0a920d0216027e6e2f378f49650573230b560922Location: ControllerNumber: 0UniqueId: Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000KeyLayoutFile: /system/usr/keylayout/qwerty.klKeyCharacterMapFile: /system/usr/keychars/qwerty.kcmConfigurationFile: /system/usr/idc/qwerty.idcVideoDevice: <none>5: mtk-kpd	//MTK 键盘Classes: KEYBOARDPath: /dev/input/event1Enabled: trueDescriptor: f0d2e427e7a05eb6d316f5e14800c5ac7b6aee79Location: ControllerNumber: 0UniqueId: Identifier: bus=0x0019, vendor=0x2454, product=0x6500, version=0x0010KeyLayoutFile: /system/usr/keylayout/Generic.klKeyCharacterMapFile: /system/usr/keychars/Generic.kcmConfigurationFile: VideoDevice: <none>-1: Virtual	//虚拟键盘Classes: KEYBOARD | ALPHAKEY | DPAD | VIRTUAL	//键盘、字母键、方向键、虚拟输入Path: <virtual>Enabled: trueDescriptor: a718a782d34bc767f4689c232d64d527998ea7fdLocation: ControllerNumber: 0UniqueId: <virtual>Identifier: bus=0x0000, vendor=0x0000, product=0x0000, version=0x0000KeyLayoutFile: /system/usr/keylayout/Generic.klKeyCharacterMapFile: /system/usr/keychars/Virtual.kcmConfigurationFile: VideoDevice: <none>Unattached video devices:	//未连接的视屏设备<none>	//当前没有未连接的或分离的视觉设备//设备事件的输入状态
Input Reader State (Nums of device: 5):Device 3: touchpanel	//触摸面板EventHub Devices: [ 2 ] Generation: 19	//版本IsExternal: falseAssociatedDisplayPort: <none>AssociatedDisplayUniqueId: <none>HasMic:     falseSources: 0x00001103KeyboardType: 1ControllerNum: 0Motion Ranges:X: source=0x00001002, min=0.000, max=1079.000, flat=0.000, fuzz=0.000, resolution=0.000	//X坐标范围0-1080Y: source=0x00001002, min=0.000, max=2399.000, flat=0.000, fuzz=0.000, resolution=0.000	//Y坐标范围0-2400PRESSURE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000, resolution=0.000SIZE: source=0x00001002, min=0.000, max=1.000, flat=0.000, fuzz=0.000, resolution=0.000TOUCH_MAJOR: source=0x00001002, min=0.000, max=2631.805, flat=0.000, fuzz=0.000, resolution=0.000TOUCH_MINOR: source=0x00001002, min=0.000, max=2631.805, flat=0.000, fuzz=0.000, resolution=0.000TOOL_MAJOR: source=0x00001002, min=0.000, max=2631.805, flat=0.000, fuzz=0.000, resolution=0.000TOOL_MINOR: source=0x00001002, min=0.000, max=2631.805, flat=0.000, fuzz=0.000, resolution=0.000Keyboard Input Mapper:Parameters:OrientationAware: falseHandlesKeyRepeat: falseKeyboardType: 1Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 0Touch Input Mapper (mode - DIRECT):Parameters:GestureMode: MULTI_TOUCHDeviceType: TOUCH_SCREENAssociatedDisplay: hasAssociatedDisplay=true, isExternal=false, displayId=''OrientationAware: trueOrientation: ORIENTATION_0Raw Touch Axes:X: min=0, max=5399, flat=0, fuzz=0, resolution=0Y: min=0, max=11999, flat=0, fuzz=0, resolution=0Pressure: unknown rangeTouchMajor: min=0, max=255, flat=0, fuzz=0, resolution=0TouchMinor: unknown rangeToolMajor: unknown rangeToolMinor: unknown rangeOrientation: unknown rangeDistance: unknown rangeTiltX: unknown rangeTiltY: unknown rangeTrackingId: min=0, max=65535, flat=0, fuzz=0, resolution=0Slot: min=0, max=9, flat=0, fuzz=0, resolution=0Calibration:touch.size.calibration: GEOMETRICtouch.pressure.calibration: nonetouch.orientation.calibration: nonetouch.distance.calibration: nonetouch.coverage.calibration: noneAffine Transformation:X scale: 1.000X ymix: 0.000X offset: 0.000Y xmix: 0.000Y scale: 1.000Y offset: 0.000//对应的屏幕id为0,屏幕物理尺寸为[0, 0, 1080, 2400],输入设备分辨率为[1080, 2400]Viewport INTERNAL: displayId=0, uniqueId=local:0, port=0, orientation=0, logicalFrame=[0, 0, 1080, 2400], physicalFrame=[0, 0, 1080, 2400], deviceSize=[1080, 2400], isActive=[1]DisplayWidth: 1080pxDisplayHeight: 2400pxPhysicalWidth: 1080pxPhysicalHeight: 2400pxPhysicalLeft: 0PhysicalTop: 0InputDeviceOrientation: 0Translation and Scaling Factors:XScale: 0.200YScale: 0.200XPrecision: 5.000YPrecision: 5.000GeometricScale: 0.200PressureScale: 0.000SizeScale: 0.004OrientationScale: 0.000DistanceScale: 0.000HaveTilt: falseTiltXCenter: 0.000TiltXScale: 0.000TiltYCenter: 0.000TiltYScale: 0.000Last Raw Button State: 0x00000000Last Raw Touch: pointerCount=1[0]: id=0, x=2302, y=5635, pressure=10, touchMajor=5, touchMinor=5, toolMajor=10, toolMinor=10, orientation=0, tiltX=0, tiltY=0, distance=0, toolType=1, isHovering=falseLast Cooked Button State: 0x00000000Last Cooked Touch: pointerCount=1[0]: id=0, x=460.400, y=1127.000, dx=0.000, dy=0.000, pressure=1.000, touchMajor=1.000, touchMinor=1.000, toolMajor=1.000, toolMinor=1.000, orientation=0.000, tilt=0.000, distance=0.000, toolType=1, isHovering=falseStylus Fusion:ExternalStylusConnected: falseExternal Stylus ID: -1External Stylus Data Timeout: 9223372036854775807External Stylus State:When: 9223372036854775807Pressure: 0.000000Button State: 0x00000000Tool Type: 0Device 4: ACCDET //耳机插入检测EventHub Devices: [ 1 ] Generation: 15IsExternal: falseAssociatedDisplayPort: <none>AssociatedDisplayUniqueId: <none>HasMic:     falseSources: 0x80000101KeyboardType: 1ControllerNum: 0Switch Input Mapper:SwitchValues: 0Keyboard Input Mapper:Parameters:OrientationAware: falseHandlesKeyRepeat: falseKeyboardType: 1Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 0Device 0: qwerty //内建键盘EventHub Devices: [ 0 ] Generation: 9IsExternal: falseAssociatedDisplayPort: <none>AssociatedDisplayUniqueId: <none>HasMic:     falseSources: 0x00000101KeyboardType: 1ControllerNum: 0Keyboard Input Mapper:Parameters:OrientationAware: trueHandlesKeyRepeat: falseKeyboardType: 1Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 0Device 2: mtk-kpd //MTK键盘EventHub Devices: [ 5 ] Generation: 6IsExternal: falseAssociatedDisplayPort: <none>AssociatedDisplayUniqueId: <none>HasMic:     falseSources: 0x00000101KeyboardType: 1ControllerNum: 0Keyboard Input Mapper:Parameters:OrientationAware: falseHandlesKeyRepeat: falseKeyboardType: 1Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 226639450000Device -1: Virtual  //虚拟键盘EventHub Devices: [ -1 ] Generation: 3IsExternal: falseAssociatedDisplayPort: <none>AssociatedDisplayUniqueId: <none>HasMic:     falseSources: 0x00000301KeyboardType: 2ControllerNum: 0Keyboard Input Mapper:Parameters:OrientationAware:<

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com