手机桌面左右滑屏不成功问题log分析

news/2025/2/5 6:59:56/

问题背景

        滑动测试,单手握持测试机,大拇指在测试机桌面做左右滑屏操作,偶现滑屏不成功。

问题分析步骤

(1)首先根据“视频”或者“log中关于问题现象的关键log”确定“问题发生的大致时间段”和“问题发生时的具体操作”大致方法如下:

问题发生时间:09-16 10:16:41.834249  到  09-16 10:16:53.891858
问题现象:6组左右划操作,第3次左划和第6次左划不成功
手机按下和抬起操作的main_log关键字:[MotionEvent] ViewRootImpl windowName

(2)根据测试的实际操作和相关流程(这里是在桌面左右滑动)的差异去判断问题出现的原因;

        报点报线正常,说明系统接收到了滑动事件,从视频和log分析可知,是由于滑动长度未满足 workspace 的条件,所以Input未下发 "切换workspace" 的请求,属于正常现象;(Launcher.Workspace:在手机桌面左右滑动时的几个界面,用于放置桌面的app图标)

main_log分析如下,截取了复现问题的main_log:

//Input检测到用户在桌面滑动了3次

09-16 10:16:49.777847  2195  2195 D Input: [MotionEvent] ViewRootImpl windowName 'com.ui.home/com.ui.home.launcher.Launcher', { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=208167702, downTime=208167702, phoneEventTime=10:16:49.775 } moveCount:009-16 10:16:49.893512  2195  2195 D Input: [MotionEvent] ViewRootImpl windowName 'com.ui.home/com.ui.home.launcher.Launcher', { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=208167818, downTime=208167702, phoneEventTime=10:16:49.892 } moveCount:509-16 10:16:50.344652  2195  2195 D Input: [MotionEvent] ViewRootImpl windowName 'com.ui.home/com.ui.home.launcher.Launcher', { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=208168269, downTime=208168269, phoneEventTime=10:16:50.343 } moveCount:009-16 10:16:50.442332  2195  2195 D Input: [MotionEvent] ViewRootImpl windowName 'com.ui.home/com.ui.home.launcher.Launcher', { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=208168367, downTime=208168269, phoneEventTime=10:16:50.440 } moveCount:409-16 10:16:50.894127  2195  2195 D Input: [MotionEvent] ViewRootImpl windowName 'com.ui.home/com.ui.home.launcher.Launcher', { action=ACTION_DOWN, id[0]=0, pointerCount=1, eventTime=208168818, downTime=208168818, phoneEventTime=10:16:50.891 } moveCount:009-16 10:16:51.027145  2195  2195 D Input: [MotionEvent] ViewRootImpl windowName 'com.ui.home/com.ui.home.launcher.Launcher', { action=ACTION_UP, id[0]=0, pointerCount=1, eventTime=208168951, downTime=208168818, phoneEventTime=10:16:51.024 } moveCount:7

//桌面workspace切换了3次,1表示切换到第1页,0表示切换到第0页

09-16 10:16:50.206216  2195  2195 D ScreenView_Workspace: setCurrentScreenInner:109-16 10:16:50.722712  2195  2195 D ScreenView_Workspace: setCurrentScreenInner:009-16 10:16:51.372863  2195  2195 D ScreenView_Workspace: setCurrentScreenInner:0

上述log第3次切换,是从第0页切换到第0页,说明Workspace有切换的操作,只是因为滑动的长度较短,系统判定成了本页内滑动。

log关键字

【main_log关键字】

ScreenView_Workspace: onIntercept                ViewGroup是否拦截下发的滑动事件;

ScreenView_Workspace: not intercept              不拦截

ScreenView_Workspace: on touch up               触摸事件结束

ScreenView_Workspace: snapByVelocity         根据速度切换桌面

ScreenView_Workspace: startScroll                 滑动操作起点的X坐标

ScreenView_Workspace: setCurrentScreenInner:1    设置桌面当前工作空间

【控制页面滑动的主要类】

PagedView.java:/packages/apps/Launcher3/src/com/android/launcher3/PagedView.java

参考文档

Android滑屏介绍:

https://blog.csdn.net/qinjuning/article/details/7247126

http://t.zoukankan.com/seven1979-p-4371555.html

launcher3源码流程解析(系列文章):

https://blog.csdn.net/picasso_l/article/details/69568486

https://blog.csdn.net/Picasso_L/article/details/69949132

https://blog.csdn.net/Picasso_L/article/details/70140694

关于View的学习点:

https://blog.csdn.net/subaohao/article/details/44355849

桌面滑动代码流程解析:https://blog.csdn.net/baidu_nod/article/details/38443499

laucher之workspace滑动:https://blog.csdn.net/u013899706/article/details/77940572

workspace详细代码功能解析:https://www.bbsmax.com/A/B0zqMvaXzv/


http://www.ppmy.cn/news/764101.html

相关文章

adb控制手机屏幕滑动

前言: 这个用的是小米手机,在“开发者选项中”把 “USB调试”和**“USB调试(安全设置**)”两个都打开, 也可以把 指针位置 打开 来看触控点在屏幕的坐标: 2 adb 划动相册 其中 1.choice /t 1 /d y /n &…

全板子题G划 P2

【模板】最近公共祖先&#xff08;LCA&#xff09; 水温逐渐升高 #include<bits/stdc.h> using namespace std; const int N 5e5 10; int n,m,s; vector<int> ed[N]; int dp[N][21],dep[N];void dfs(int x,int fa){for(int i 1;i < 20;i)dp[x][i] dp[dp[x…

【移动端】滑动验证致使整个屏幕都在动

最近发现一款JQ图片滑动验证的代码。当手机端拖动按钮元素时&#xff0c;会触发手机浏览器自带事件&#xff0c;导致滑动失效或切屏&#xff0c;并且浏览器报错。 [Intervention] Unable to preventDefault inside passive event listener due to target being treated as pas…

移动端滑动验证为什么整个屏幕都在动?

开发手机移动端验证时&#xff0c;发现拖动元素会触发手机浏览器自带事件&#xff0c;导致滑动失效或切屏&#xff0c; 解决方法&#xff1a; html{touch-action:none;touch-action:pan-y; }var startX,startY;document.addEventListener("touchstart",function(e)…

cocos creator 划动屏幕以移动摄像机

本来代码是这么写的&#xff0c;在浏览器中运行也是好的。 cc.Class({extends: cc.Component,properties: {_begin: cc.Integer,_end: cc.Integer,_origin: cc.Integer,_camera: cc.Node,},onLoad () {// 找到摄像机this.camera cc.find("Canvas/Main Camera");// …

【第三章 flutter学习之Dart基础(上)】

文章目录 一、入口方法的定义方式二、Dart变量和常量三、Dart常用数据类型四、Dart运算符与类型转换及循环语句五、自定义方法六、Dart静态成员、操作符、类的继承七、接口八、接口分离写法九、一个类实现多个接口 一、入口方法的定义方式 main(){print(hello world) } //下边…

NTKO 控件安装失败,请检查安全设置解决方法。

如果各种设置都无效的话&#xff0c;可以尝试以管理员方式打开浏览器再安装试试。

什么是 Spring 框架?使用 Spring 框架的好处是什么?Spring 框架中用到了哪些设计模式?

什么是 Spring 框架? Spring 是一种轻量级开发框架&#xff0c;旨在提高开发人员的开发效率以及系统的可维护性。 Spring 官网&#xff1a;https://spring.io/ Spring 框架指的是 Spring Framework&#xff0c;它是很多模块的集合&#xff0c;使用这些模块可以很方便地协助…