当前位置: 首页 > news >正文

佛山做外贸网站服务WordPress中国市场规模

佛山做外贸网站服务,WordPress中国市场规模,大连设计网站的公司,黄图网站有哪些 推荐hi#xff0c;粉丝朋友们#xff1a; 背景 大家好#xff01;近来居然有好几个粉丝朋友居然问到了一个虚拟屏幕触摸相关的问题#xff0c;还有老版本android 10上面有个车载桌面使用的ActivityView可以正常触摸的问题。 其实这个ActivityView在最新的版本已经没有了…hi粉丝朋友们 背景 大家好近来居然有好几个粉丝朋友居然问到了一个虚拟屏幕触摸相关的问题还有老版本android 10上面有个车载桌面使用的ActivityView可以正常触摸的问题。 其实这个ActivityView在最新的版本已经没有了所以以前的话没有去重点分析这个ActivityView触摸部分的原理剖析但是发现虽然没有了ActivityView。但是很多同学还是喜欢自己在高版本又写一个类似的ActivityView。基于这个背景下拿出老版本的ActivityView分析一下其实现原理还是有必要哈。前面的blog本身已经分析了ActivityView的显示Activity原理部分本节就来重点分析ActvityView是怎么在系统中正常触摸的。 为了分析这个ActivityView的触摸原理我这边特别下载了android 10的代码编译好了一个car的模拟器进行验证分析 车载桌面的当前表现 目前车载的桌面显示如下图绿色的“”No maps …“”这个区域就是ActivityView他属于搞了个新的虚拟Display然后启动的Activity。所以这里的就会存在在CarLauncher上面显示两个Activity一个是桌面自己一个是地图绿色的Activity但是大家注意哈这里的绿色区域的地图Activity明显属于另一个display这里我们是知道的触摸都是每个display独立的即多屏display显示都是有各自display的触摸节点。 但是目前画面都显示在主屏幕display0这个屏幕所以我们触摸绿色区域肯定触摸事件是display0的肯定不会到虚拟display去这个是我们的理论分析的哈认为如果要虚拟display有事件必须要手动注入模拟相关的触摸事件注入到虚拟display。但事实真的是这样吗 认为绿色虚拟屏幕不可能有触摸事件接受我们来验证一下是不是触摸没有触摸事件 为了验证在地图容器Activity的dispatchTouchEvent有日志打印以此来确定是否有事件到Activity。 实际上在触摸绿色区域时候发现有对于事件 bash 11-13 00:29:48.738 3638 3638 I lsm11 : dispatchTouchEvent ev MotionEvent { actionACTION_DOWN, actionButton0, id[0]0, x[0]188.97656, y[0]107.98242, toolType[0]TOOL_TYPE_FINGER, buttonState0, classificationNONE, metaState0, flags0x0, edgeFlags0x0, pointerCount1, historySize0, eventTime2719884, downTime2719884, deviceId0, source0x1002, displayId0 }11-13 00:29:48.851 3638 3638 I lsm11 : dispatchTouchEvent ev MotionEvent { actionACTION_UP, actionButton0, id[0]0, x[0]188.97656, y[0]107.98242, toolType[0]TOOL_TYPE_FINGER, buttonState0, classificationNONE, metaState0, flags0x0, edgeFlags0x0, pointerCount1, historySize0, eventTime2719996, downTime2719884, deviceId0, source0x1002, displayId0 }看到结果是不是感觉自己被狠狠打脸了。。。。。 为啥可以收到触摸主屏幕触摸事件呢activity明明显示在另一个display 问题追踪分析线索 怀疑线索1 11-13 00:29:48.738 3638 3638 I lsm11 : dispatchTouchEvent ev MotionEvent { actionACTION_DOWN, actionButton0, id[0]0, x[0]188.97656, y[0]107.98242, toolType[0]TOOL_TYPE_FINGER, buttonState0, classificationNONE, metaState0, flags0x0, edgeFlags0x0, pointerCount1, historySize0, eventTime2719884, downTime2719884, deviceId0, source0x1002, displayId0 } 看这里触摸事件时候大家是不是发现明明这个displayId居然还是0明显不太和逻辑是吧正常触摸事件是不是应该为displayId 1假设虚拟屏幕是displayId 1 不过换着想一下这个displayId决定是inputreader即说明在inputreader时候就认为是主屏幕事件故立马吧方向就不用放到inputreader部分 线索2 dumpsys input INPUT MANAGER (dumpsys input)Input Manager State:Interactive: trueSystem UI Visibility: 0x8008Pointer Speed: 0Pointer Gestures Enabled: trueShow Touches: falsePointer Capture Enabled: falseEvent Hub State:BuiltInKeyboardId: 2Devices:-1: VirtualClasses: 0x40000023Path: virtualEnabled: trueDescriptor: a718a782d34bc767f4689c232d64d527998ea7fdLocation: ControllerNumber: 0UniqueId: virtualIdentifier: bus0x0000, vendor0x0000, product0x0000, version0x0000KeyLayoutFile: /system/usr/keylayout/Generic.klKeyCharacterMapFile: /system/usr/keychars/Virtual.kcmConfigurationFile: HaveKeyboardLayoutOverlay: falseVideoDevice: none1: Power ButtonClasses: 0x00000001Path: /dev/input/event0Enabled: trueDescriptor: 26d13db3fa0f6bd5d05831266fb01ea6c500b88cLocation: LNXPWRBN/button/input0ControllerNumber: 0UniqueId: Identifier: bus0x0019, vendor0x0000, product0x0001, version0x0000KeyLayoutFile: /system/usr/keylayout/Generic.klKeyCharacterMapFile: /system/usr/keychars/Generic.kcmConfigurationFile: HaveKeyboardLayoutOverlay: falseVideoDevice: none2: qwerty2 (aka device 0 - built-in keyboard)Classes: 0x000000bdPath: /dev/input/event1Enabled: trueDescriptor: 04c0f71d9920e1e448166e8a4feebf80d1849c2fLocation: ControllerNumber: 0UniqueId: Identifier: bus0x0019, vendor0x0000, product0x0000, version0x0000KeyLayoutFile: /system/usr/keylayout/qwerty.klKeyCharacterMapFile: /system/usr/keychars/qwerty2.kcmConfigurationFile: /system/usr/idc/qwerty2.idcHaveKeyboardLayoutOverlay: falseVideoDevice: none3: goldfish_rotaryClasses: 0x00001000Path: /dev/input/event2Enabled: trueDescriptor: 9286b20e4aaa6bcaca619b728b030e3f7b422ee6Location: ControllerNumber: 0UniqueId: Identifier: bus0x0019, vendor0x0000, product0x0000, version0x0000KeyLayoutFile: KeyCharacterMapFile: ConfigurationFile: /vendor/usr/idc/goldfish_rotary.idcHaveKeyboardLayoutOverlay: falseVideoDevice: noneUnattached video devices:noneInput Reader State:Device -1: VirtualGeneration: 2IsExternal: falseAssociatedDisplayPort: noneHasMic: falseSources: 0x00000301KeyboardType: 2Keyboard Input Mapper:Parameters:OrientationAware: falseHandlesKeyRepeat: falseKeyboardType: 2Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 0Device 0: qwerty2Generation: 12IsExternal: falseAssociatedDisplayPort: noneHasMic: falseSources: 0x80011307KeyboardType: 1Motion Ranges:X: source0x00010004, min-1.000, max1.000, flat0.000, fuzz0.167, resolution0.000Y: source0x00010004, min-1.000, max1.000, flat0.000, fuzz0.167, resolution0.000PRESSURE: source0x00010004, min0.000, max1.000, flat0.000, fuzz0.000, resolution0.000X: source0x00001002, min0.000, max799.000, flat0.000, fuzz0.000, resolution0.000Y: source0x00001002, min0.000, max479.000, flat0.000, fuzz0.000, resolution0.000PRESSURE: source0x00001002, min0.000, max1.000, flat0.000, fuzz0.000, resolution0.000SIZE: source0x00001002, min0.000, max1.000, flat0.000, fuzz0.000, resolution0.000TOUCH_MAJOR: source0x00001002, min0.000, max932.952, flat0.000, fuzz0.000, resolution0.000TOUCH_MINOR: source0x00001002, min0.000, max932.952, flat0.000, fuzz0.000, resolution0.000TOOL_MAJOR: source0x00001002, min0.000, max932.952, flat0.000, fuzz0.000, resolution0.000TOOL_MINOR: source0x00001002, min0.000, max932.952, flat0.000, fuzz0.000, resolution0.000Switch Input Mapper:SwitchValues: 0Keyboard Input Mapper:Parameters:OrientationAware: trueHandlesKeyRepeat: falseKeyboardType: 1Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 0Cursor Input Mapper:Parameters:HasAssociatedDisplay: trueMode: navigationOrientationAware: trueXScale: 0.167YScale: 0.167XPrecision: 6.000YPrecision: 6.000HaveVWheel: falseHaveHWheel: falseVWheelScale: 1.000HWheelScale: 1.000Orientation: 0ButtonState: 0x00000000Down: falseDownTime: 0Touch Input Mapper (mode - direct):Parameters:GestureMode: multi-touchDeviceType: touchScreenAssociatedDisplay: hasAssociatedDisplaytrue, isExternalfalse, displayIdOrientationAware: trueRaw Touch Axes:X: min0, max32767, flat0, fuzz0, resolution0Y: min0, max32767, flat0, fuzz0, resolution0Pressure: min0, max256, flat0, fuzz0, resolution0TouchMajor: min0, max2147483647, flat0, fuzz0, resolution0TouchMinor: unknown rangeToolMajor: unknown rangeToolMinor: unknown rangeOrientation: unknown rangeDistance: unknown rangeTiltX: unknown rangeTiltY: unknown rangeTrackingId: min0, max10, flat0, fuzz0, resolution0Slot: min0, max9, flat0, fuzz0, resolution0Calibration:touch.size.calibration: geometrictouch.pressure.calibration: physicaltouch.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.000Viewport INTERNAL: displayId0, uniqueIdlocal:0, port0, orientation0, logicalFrame[0, 0, 800, 480], physicalFrame[0, 0, 800, 480], deviceSize[800, 480]SurfaceWidth: 800pxSurfaceHeight: 480pxSurfaceLeft: 0SurfaceTop: 0PhysicalWidth: 800pxPhysicalHeight: 480pxPhysicalLeft: 0PhysicalTop: 0SurfaceOrientation: 0Translation and Scaling Factors:XTranslate: 0.000YTranslate: 0.000XScale: 0.024YScale: 0.015XPrecision: 40.960YPrecision: 68.267GeometricScale: 0.020PressureScale: 0.004SizeScale: 0.000OrientationScale: 0.000DistanceScale: 0.000HaveTilt: falseTiltXCenter: 0.000TiltXScale: 0.000TiltYCenter: 0.000TiltYScale: 0.000Last Raw Button State: 0x00000000Last Raw Touch: pointerCount0Last Cooked Button State: 0x00000000Last Cooked Touch: pointerCount0Stylus Fusion:ExternalStylusConnected: falseExternal Stylus ID: -1External Stylus Data Timeout: 9223372036854775807External Stylus State:When: 9223372036854775807Pressure: 0.000000Button State: 0x00000000Tool Type: 0Device 1: Power ButtonGeneration: 9IsExternal: falseAssociatedDisplayPort: noneHasMic: falseSources: 0x00000101KeyboardType: 1Keyboard Input Mapper:Parameters:OrientationAware: falseHandlesKeyRepeat: falseKeyboardType: 1Orientation: 0KeyDowns: 0 keys currently downMetaState: 0x0DownTime: 0Device 3: goldfish_rotaryGeneration: 4IsExternal: falseAssociatedDisplayPort: noneHasMic: falseSources: 0x00400000KeyboardType: 0Motion Ranges:26: source0x00400000, min-1.000, max1.000, flat0.000, fuzz0.000, resolution0.791Rotary Encoder Input Mapper:HaveWheel: trueConfiguration:ExcludedDeviceNames: []VirtualKeyQuietTime: 0.0msPointerVelocityControlParameters: scale1.000, lowThreshold500.000, highThreshold3000.000, acceleration3.000WheelVelocityControlParameters: scale1.000, lowThreshold15.000, highThreshold50.000, acceleration4.000PointerGesture:Enabled: trueQuietInterval: 100.0msDragMinSwitchSpeed: 50.0px/sTapInterval: 150.0msTapDragInterval: 300.0msTapSlop: 20.0pxMultitouchSettleInterval: 100.0msMultitouchMinDistance: 15.0pxSwipeTransitionAngleCosine: 0.3SwipeMaxWidthRatio: 0.2MovementSpeedRatio: 0.8ZoomSpeedRatio: 0.3Viewports:Viewport INTERNAL: displayId0, uniqueIdlocal:0, port0, orientation0, logicalFrame[0, 0, 800, 480], physicalFrame[0, 0, 800, 480], deviceSize[800, 480]Input Classifier State:Motion Classifier:nullptrInput Dispatcher State:DispatchEnabled: trueDispatchFrozen: falseInputFilterEnabled: falseFocusedDisplayId: 2FocusedApplications:displayId3, nameAppWindowToken{34ea2d9 tokenToken{6cc1920 ActivityRecord{e2df023 u10 android.car.cluster/.FakeFreeNavigationActivity t1000019}}}, dispatchingTimeout5000.000msdisplayId2, nameAppWindowToken{7f21912 tokenToken{601109d ActivityRecord{c985374 u10 com.android.car.mapsplaceholder/.MapsPlaceholderActivity t1000018}}}, dispatchingTimeout5000.000msdisplayId1, nameAppWindowToken{ba4478b tokenToken{f67795a ActivityRecord{aba2505 u0 android.car.cluster/.MainClusterActivity t5}}}, dispatchingTimeout5000.000msdisplayId0, nameAppWindowToken{b53bbef tokenToken{3bc30ce ActivityRecord{f6201c9 u10 com.android.car.carlauncher/.CarLauncher t1000002}}}, dispatchingTimeout5000.000msFocusedWindows:displayId0, nameWindow{71ec913 u10 com.android.car.carlauncher/com.android.car.carlauncher.CarLauncher}displayId2, nameWindow{36a3ea8 u10 com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity}displayId3, nameWindow{752545a u10 android.car.cluster/android.car.cluster.FakeFreeNavigationActivity}displayId1, nameWindow{96a3c94 u0 android.car.cluster/android.car.cluster.MainClusterActivity}TouchStates: no displays touchedDisplay: 3Windows:0: nameWindow{752545a u10 android.car.cluster/android.car.cluster.FakeFreeNavigationActivity}, displayId3, portalToDisplayId-1, pausedfalse, hasFocustrue, hasWallpaperfalse, visibletrue, canReceiveKeystrue, flags0x01810520, type0x00000001, layer0, frame[0,0][1280,520], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[0,0][1280,520], inputFeatures0x00000000, ownerPid3735, ownerUid1001000, dispatchingTimeout5000.000msDisplay: 2Windows:0: nameWindow{36a3ea8 u10 com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity}, displayId2, portalToDisplayId-1, pausedfalse, hasFocustrue, hasWallpaperfalse, visibletrue, canReceiveKeystrue, flags0x81810120, type0x00000001, layer0, frame[12,69][474,384], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[12,69][474,384], inputFeatures0x00000000, ownerPid3638, ownerUid1010066, dispatchingTimeout5000.000msDisplay: 1Windows:0: nameWindow{96a3c94 u0 android.car.cluster/android.car.cluster.MainClusterActivity}, displayId1, portalToDisplayId-1, pausedfalse, hasFocustrue, hasWallpaperfalse, visibletrue, canReceiveKeystrue, flags0x01810520, type0x00000001, layer0, frame[0,0][1280,720], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[0,0][1280,720], inputFeatures0x00000000, ownerPid3472, ownerUid1000, dispatchingTimeout5000.000msDisplay: 0Windows:0: nameWindow{263dc87 u0 CarNavigationBar}, displayId0, portalToDisplayId-1, pausedfalse, hasFocusfalse, hasWallpaperfalse, visibletrue, canReceiveKeysfalse, flags0x01840028, type0x000007e3, layer0, frame[0,396][800,480], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[0,396][800,480], inputFeatures0x00000000, ownerPid2020, ownerUid10099, dispatchingTimeout5000.000ms1: nameWindow{586637c u0 StatusBar}, displayId0, portalToDisplayId-1, pausedfalse, hasFocusfalse, hasWallpaperfalse, visibletrue, canReceiveKeysfalse, flags0x81840048, type0x000007d0, layer0, frame[0,0][800,57], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[0,0][800,57], inputFeatures0x00000000, ownerPid2020, ownerUid10099, dispatchingTimeout5000.000ms2: nameWindow{71ec913 u10 com.android.car.carlauncher/com.android.car.carlauncher.CarLauncher}, displayId0, portalToDisplayId-1, pausedfalse, hasFocustrue, hasWallpapertrue, visibletrue, canReceiveKeystrue, flags0x81910120, type0x00000001, layer0, frame[0,0][800,480], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[0,0][800,69]|[0,69][12,384]|[474,69][800,384]|[0,384][800,480], inputFeatures0x00000000, ownerPid3531, ownerUid1001000, dispatchingTimeout5000.000ms3: nameSurface(nameActivityViewVirtualDisplay)/0x8f6acba, displayId0, portalToDisplayId2, pausedfalse, hasFocusfalse, hasWallpaperfalse, visibletrue, canReceiveKeysfalse, flags0x00800028, type0x00000000, layer0, frame[12,69][474,384], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[12,69][474,384], inputFeatures0x00000000, ownerPid1875, ownerUid1000, dispatchingTimeout0.000ms4: nameWindow{5bed72e u10 com.android.systemui.ImageWallpaper}, displayId0, portalToDisplayId-1, pausedfalse, hasFocusfalse, hasWallpaperfalse, visibletrue, canReceiveKeysfalse, flags0x00014318, type0x000007dd, layer0, frame[0,0][963,480], globalScale1.000000, windowScale(2.666667,2.666667), touchableRegion[0,0][361,180], inputFeatures0x00000000, ownerPid2528, ownerUid1010099, dispatchingTimeout5000.000ms 这里我们仔细看我们发现主屏幕display 0有一个Window 3: nameSurface(nameActivityViewVirtualDisplay)/0x8f6acba, displayId0, portalToDisplayId2, pausedfalse, hasFocusfalse, hasWallpaperfalse, visibletrue, canReceiveKeysfalse, flags0x00800028, type0x00000000, layer0, frame[12,69][474,384], globalScale1.000000, windowScale(1.000000,1.000000), touchableRegion[12,69][474,384], inputFeatures0x00000000, ownerPid1875, ownerUid1000, dispatchingTimeout0.000ms这个Surface(nameActivityViewVirtualDisplay)就是ActivityView专门创建的一个input层面的window仔细分析他的时候发现有一个变量引起我们的注意 portalToDisplayId2, 明显其他窗口都是 -1他是2而且这个2又刚好是我们的虚拟display的Id哈哈哈到了这里大家就是不是找到核心问题点。 原理流程分析 寻找触摸事件接受窗口时候会根据判断这个portalToDisplayId值如果有这个值会重新遍历这个displayId上的window代替自己这个display的window。即实现了Surface(nameActivityViewVirtualDisplay)/0x8f6acba这窗口的触摸事件接受都转到了displayId portalToDisplayId的window上 0: name‘Window{36a3ea8 u10 com.android.car.mapsplaceholder/com.android.car.mapsplaceholder.MapsPlaceholderActivity}’, displayId2, 那么这个portalToDisplayId谁设置的呢 其实是ActivityView调用的reparentDisplayContent 接下来到了wms中执行 这里调用到了DisplayContent 好那么今天就把ActivityView的触摸部分就原理剖析完成弥补了网络上这块的技术空白方便大家学习大家想要学习更多framework高深干货技术那就跟着马哥很多干货课程需要的课程优惠的可以v(androidframework007)
http://www.sadfv.cn/news/334170/

相关文章:

  • 齐齐哈尔企业网站排名优化吉林省住房和城乡建设厅网站官网
  • 官网的网站开发费用湖北专业的网瘾学校哪家口碑好
  • 网站开发的职业规划如何免费建立可以交流的网站
  • 柳城网站注册营业执照申请
  • 做网站程序的步骤网页设计培训贵不贵
  • 在微信上怎么做网站c苏宁网站开发
  • 柴油发电机组网站建设价格天津电子商务网站
  • 移动端网站seowordpress静态设置方法
  • 什么是网站名称汽车配件网上商城
  • 白山市网站建设鹤壁市城乡一体化示范区官网入口
  • 做旅游网站用什么颜色h5页面版式设计有哪些方法
  • 枣庄建设网站网站界面设计中的布局设计要注意什么的结合
  • 微网站开发 付费阅读python做网站好用吗
  • 哈尔滨门户网站制作哪家好企业注册信息
  • 如何做简单网站首页wordpress分享到快手
  • 祥云平台英文网站注册会计师协会
  • 网站的登录注册页面怎么做的制作自己的网站 域名怎么弄
  • 成都金牛区建设局网站男女做啊免费视频网站
  • dw做网站实例怎么区分网站的好坏
  • 开发系统网站建设做电影网站侵权
  • 中山网站推广词浪漫表白网页一键生成
  • 东莞网站搜索排名the ken wordpress
  • 网页设计与制作黑马程序员云南网络营销文化优化
  • 访问量大的网站带宽什么网站上做指甲最便宜
  • 厦门网站公司wordpress搜狗收录
  • 用net语言做网站平台好不好网关高性能 网站建设
  • 永川集团网站建设怎样搭建个人网站
  • 做邮轮的网站哪些网站可以做海报热点的
  • 建设银行行号网站查询是什么意思关键词采集软件
  • 游戏网站域名杭州购物网站建设