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

做商城网站系统重庆网站制作珠海公司

做商城网站系统,重庆网站制作珠海公司,金华百度seo,中国风html5网站模板免费下载用来记录学习wms#xff0c;后续会一点一点更新。。。。。。 代码#xff1a;android14 WMS是在SystemServer进程中启动的 在SystemServer中的main方法中#xff0c;调用run方法。 private void run() { // Initialize native services.初始化服务#xff0c;加载andro…用来记录学习wms后续会一点一点更新。。。。。。 代码android14 WMS是在SystemServer进程中启动的 在SystemServer中的main方法中调用run方法。 private void run() { // Initialize native services.初始化服务加载android_servers so库 870 System.loadLibrary(android_servers); // Create the system service manager.创建SystemServiceManager 895 mSystemServiceManager new SystemServiceManager(mSystemContext);942 startOtherServices(t);//android14在startOtherServices中启动WindowManagerService android14中在startOtherServices中启动WindowManagerService 1606 wm WindowManagerService.main(context, inputManager, !mFirstBoot, 1607 new PhoneWindowManager(), mActivityManagerService.mActivityTaskManager);该代码执行了WMS的main方法会在内部创建一个WMS。其中有一个参数inputManager也是在startOtherServices中创建的如下。 1589 t.traceBegin(StartInputManagerService); 1590 inputManager new InputManagerService(context); 总结WMS的main方法在startOtherServices中而startOtherServices在SystemServer的run方法中运行在system_server线程中。 1608 ServiceManager.addService(Context.WINDOW_SERVICE, wm, /* allowIsolated */ false, 1609 DUMP_FLAG_PRIORITY_CRITICAL | DUMP_FLAG_PROTO); 1610 ServiceManager.addService(Context.INPUT_SERVICE, inputManager, 1611 /* allowIsolated */ false, DUMP_FLAG_PRIORITY_CRITICAL);上述代码将WMS和IMS注册到ServerManager中。 回到上述的WindowManagerService main中。 /frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java 1137 public static WindowManagerService main(final Context context, final InputManagerService im, 1138 final boolean showBootMsgs, WindowManagerPolicy policy, ActivityTaskManagerService atm, 1139 DisplayWindowSettingsProvider displayWindowSettingsProvider, 1140 SupplierSurfaceControl.Transaction transactionFactory, 1141 FunctionSurfaceSession, SurfaceControl.Builder surfaceControlFactory) { 1142 final WindowManagerService[] wms new WindowManagerService[1]; 1143 DisplayThread.getHandler().runWithScissors(() - 1144 wms[0] new WindowManagerService(context, im, showBootMsgs, policy, atm, 1145 displayWindowSettingsProvider, transactionFactory, 1146 surfaceControlFactory), 0); 1147 return wms[0]; 1148 }DisplayThread.getHandler().runWithScissors调用DisplayThread的getHandler方法获得DisplayThread的handler实例。 可以用来处理需要低延时显示的相关操作。 这张图可以清晰的了解到不管是applicationWindow还是SystemWindow都是由WindowManager和WMS处理。 addwindow public int addWindow(Session session, IWindow client, LayoutParams attrs, int viewVisibility, 1432 int displayId, int requestUserId, InsetsType int requestedVisibleTypes, 1433 InputChannel outInputChannel, InsetsState outInsetsState, 1434 InsetsSourceControl.Array outActiveControls, Rect outAttachedFrame, 1435 float[] outSizeCompatScale) {int res mPolicy.checkAddPermission(attrs.type, isRoundedCornerOverlay, attrs.packageName, 1441 appOp); 上述通过checkAddpermission方法来检测权限如果没有权限则不会执行后续代码。 1457 final DisplayContent displayContent getDisplayContentOrCreate(displayId, attrs.token);上述代码中有一个参数displayId,该参数获得窗口添加到哪个DisplayContent上。 if (displayContent null) { 1460 ProtoLog.w(WM_ERROR, Attempted to add window to a display that does 1461 not exist: %d. Aborting., displayId); 1462 return WindowManagerGlobal.ADD_INVALID_DISPLAY; 1463 }如果displatContent等于null则会返回一个ADD_INVALID_DISPLAY无效的状态类似的还有成功的状态这些状态都在WindowManagerGlobal中被定义。 if (type FIRST_SUB_WINDOW type LAST_SUB_WINDOW) { 1478 parentWindow windowForClientLocked(null, attrs.token, false); 1479 if (parentWindow null) { 1480 ProtoLog.w(WM_ERROR, Attempted to add window with token that is not a window: 1481 %s. Aborting., attrs.token); 1482 return WindowManagerGlobal.ADD_BAD_SUBWINDOW_TOKEN; 1483 }上述的一个判断type代码窗口类型它介于FIRST_SUB_WINDOW和LAST_SUB_WINDOW之间FIRST_SUB_WINDOW和LAST_SUB_WINDOW值定义在windowmanger中 通常Window有三种类型以及它们的值范围分别是 Application Window应用窗口 1-99 Sub Window子窗口1000-1999 System Window系统窗口2000-2999 所以上述可以看出上述窗口是一个子窗口。 1478 parentWindow windowForClientLocked(null, attrs.token, false); 看一下windowforclientLocked方法 6033 final WindowState windowForClientLocked(Session session, IWindow client, boolean throwOnError) { 6034 return windowForClientLocked(session, client.asBinder(), throwOnError); 6035 } 6036 6037 final WindowState windowForClientLocked(Session session, IBinder client, boolean throwOnError) { 6038 WindowState win mWindowMap.get(client); 6039 if (DEBUG) Slog.v(TAG_WM, Looking up client client : win); 6040 if (win null) { 6041 if (throwOnError) { 6042 throw new IllegalArgumentException( 6043 Requested window client does not exist); 6044 } 6045 ProtoLog.w(WM_ERROR, Failed looking up window session%s callers%s, session, 6046 Debug.getCallers(3)); 6047 return null; 6048 } 6049 if (session ! null win.mSession ! session) { 6050 if (throwOnError) { 6051 throw new IllegalArgumentException(Requested window client is in session 6052 win.mSession , not session); 6053 } 6054 ProtoLog.w(WM_ERROR, Failed looking up window session%s callers%s, session, 6055 Debug.getCallers(3)); 6056 return null; 6057 } 6058 6059 return win; 6060 }根据attrs.token作为key值从mWindowMap中得到该子窗口的父窗口如果win父类窗口等于null会返回错误。 WindowToken token displayContent.getWindowToken( 1525 hasParent ? parentWindow.mAttrs.token : attrs.token);通过displayContent的getWindowToken方法获得WindowToken if (token null) { 1535 if (!unprivilegedAppCanCreateTokenWith(parentWindow, callingUid, type, 1536 rootType, attrs.token, attrs.packageName)) { 1537 return WindowManagerGlobal.ADD_BAD_APP_TOKEN; 1538 }......1585 } else if (rootType TYPE_INPUT_METHOD) { 1586 if (token.windowType ! TYPE_INPUT_METHOD) { 1587 ProtoLog.w(WM_ERROR, Attempted to add input method window with bad token 1588 %s. Aborting., attrs.token); 1589 return WindowManagerGlobal.ADD_BAD_APP_TOKEN; 1590 }} else if (rootType TYPE_VOICE_INTERACTION) { 1592 if (token.windowType ! TYPE_VOICE_INTERACTION) { 1593 ProtoLog.w(WM_ERROR, Attempted to add voice interaction window with bad token 1594 %s. Aborting., attrs.token); 1595 return WindowManagerGlobal.ADD_BAD_APP_TOKEN; 1596 } 1597 } else if (rootType TYPE_WALLPAPER) { 1598 if (token.windowType ! TYPE_WALLPAPER) { 1599 ProtoLog.w(WM_ERROR, Attempted to add wallpaper window with bad token 1600 %s. Aborting., attrs.token); 1601 return WindowManagerGlobal.ADD_BAD_APP_TOKEN; 1602 } 1603 } else if (rootType TYPE_ACCESSIBILITY_OVERLAY) { 1604 if (token.windowType ! TYPE_ACCESSIBILITY_OVERLAY) { 1605 ProtoLog.w(WM_ERROR, 1606 Attempted to add Accessibility overlay window with bad token 1607 %s. Aborting., attrs.token); 1608 return WindowManagerGlobal.ADD_BAD_APP_TOKEN; 1609 }如果token为空则做些判断如果rootType等于TYPE_INPUT_METHOD等时会返回ADD_BAD_APP_TOKEN状态值。
http://www.yutouwan.com/news/298557/

相关文章:

  • 济宁网站建设那家好网站开发好就业吗
  • 淘宝客网站开源it运维需要具备哪些能力
  • 网站二级菜单是什么意思专业的seo搜索引擎优化培训
  • 做推广适合哪些网站小规模公司怎么注销
  • 网站内容的排版布局58同城深圳网站建设
  • 烟台网站建设比较大的如何搭建英文网站
  • 在哪个网站做外贸生意好公司做企业网站
  • 外贸建站深圳一个虚拟主机绑定2个网站
  • 佛山专业建设网站平台网站开发广告宣传语
  • 网站开发获取用户微信号登录pis粉丝做的网站
  • 网站主页设计欣赏自建网站的劣势
  • 网站制作要学多久wordpress花园破解
  • 网站推广渠道类型医疗器械查询官网
  • 百度提交网站已删内容微信引流的十个方法
  • 网站建设要如何选择网页设计与制作自学
  • 网站模块是什么做医疗网站颜色选择
  • 谷歌生成在线网站地图合购8登录WordPress
  • 深鑫辉网站建设html5播放器
  • 互联网行业网站设计网站在互联网营销中的作用
  • 有没有专门做中式的设计网站网站建设总体上可划分为两个阶段
  • 手机网站在哪里找到网站开发什么语言最好
  • 商城购物网站开发意义h5多人同时交互
  • 龙华网站设计公司南宁关键词优化软件
  • 网站建设佰首选金手指二八jsp网站 值班
  • 网站制作方案解决办法家居装修
  • 做平台交易网站怎么收款泉州网站建设哪里好
  • 中国建设监理协会网站个人会员系统栏jsp网站开发 心得
  • 网站需求分析报告范文青海省教育厅门户网站首页
  • 网站模板编辑工具网络营销的四个特点
  • 吉安市建设规划局网站淮北 网站建设