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

Android14 WMS-IWindow介绍

IWindow是很重要的,官方介绍是API back to a client window that the Window Manager uses to inform it of interesting things happening.也就是说是是用于WMS回调客户端的,当窗口有一些改变时,WMS及时调用客户端接口,让客户端窗口立即更新。

IWindow.aidl - OpenGrok cross reference for /frameworks/base/core/java/android/view/IWindow.aidl

/** * API back to a client window that the Window Manager uses to inform it of * interesting things happening. * * {@hide} */ oneway interface IWindow { /** * ===== NOTICE ===== * The first method must remain the first method. Scripts * and tools rely on their transaction number to work properly. */ /** * Invoked by the view server to tell a window to execute the specified * command. Any response from the receiver must be sent through the * specified file descriptor. */ void executeCommand(String command, String parameters, in ParcelFileDescriptor descriptor); void resized(in ClientWindowFrames frames, boolean reportDraw, in MergedConfiguration newMergedConfiguration, in InsetsState insetsState, boolean forceLayout, boolean alwaysConsumeSystemBars, int displayId, int syncSeqId, boolean dragResizing); /** * Called when this window retrieved control over a specified set of insets sources. */ void insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls); /** * Called when a set of insets source window should be shown by policy. * * @param types internal insets types (WindowInsets.Type.InsetsType) to show * @param fromIme true if this request originated from IME (InputMethodService). * @param statsToken the token tracking the current IME show request or {@code null} otherwise. */ void showInsets(int types, boolean fromIme, in @nullable ImeTracker.Token statsToken); /** * Called when a set of insets source window should be hidden by policy. * * @param types internal insets types (WindowInsets.Type.InsetsType) to hide * @param fromIme true if this request originated from IME (InputMethodService). * @param statsToken the token tracking the current IME hide request or {@code null} otherwise. */ void hideInsets(int types, boolean fromIme, in @nullable ImeTracker.Token statsToken); void moved(int newX, int newY); void dispatchAppVisibility(boolean visible); void dispatchGetNewSurface(); void closeSystemDialogs(String reason); /** * Called for wallpaper windows when their offsets or zoom level change. */ void dispatchWallpaperOffsets(float x, float y, float xStep, float yStep, float zoom, boolean sync); void dispatchWallpaperCommand(String action, int x, int y, int z, in Bundle extras, boolean sync); /** * Drag/drop events */ void dispatchDragEvent(in DragEvent event); /** * Pointer icon events */ void updatePointerIcon(float x, float y); /** * Called for non-application windows when the enter animation has completed. */ void dispatchWindowShown(); /** * Called when Keyboard Shortcuts are requested for the window. */ void requestAppKeyboardShortcuts(IResultReceiver receiver, int deviceId); /** * Called when Scroll Capture support is requested for a window. * * @param callbacks to receive responses */ void requestScrollCapture(in IScrollCaptureResponseListener callbacks); }

IWindow是怎么赋值并一步步传入WMS端的呢,由下面代码可以看出,它是在ViewRootImpl中进行赋值的

//定义 ​ final W mWindow; ... public ViewRootImpl(@UiContext Context context, Display display, IWindowSession session, WindowLayout windowLayout) { ... mWindow = new W(this); ... } W如下 static class W extends IWindow.Stub { private final WeakReference<ViewRootImpl> mViewAncestor; private final IWindowSession mWindowSession; W(ViewRootImpl viewAncestor) { mViewAncestor = new WeakReference<ViewRootImpl>(viewAncestor); mWindowSession = viewAncestor.mWindowSession; } ... public void setView(View view, WindowManager.LayoutParams attrs, View panelParentView, int userId) { //此时将mWindow传入,这个方法会一步步调用到Server端WMS中 res = mWindowSession.addToDisplayAsUser(mWindow, mWindowAttributes, getHostVisibility(), mDisplay.getDisplayId(), userId, mInsetsController.getRequestedVisibleTypes(), inputChannel, mTempInsets, mTempControls, attachedFrame, compatScale); ​
http://www.jsqmd.com/news/1405110/

相关文章:

  • 电脑搜索应用找不到如何解决
  • 2026年隐形拉链厂家怎么选?一份行业观察与选型指南 - 品牌报告
  • Genesis WordPress缓存优化终极指南:Varnish高性能缓存配置与WordPress命中率提升技巧
  • 7-Zip-zstd压缩工具完全指南:一步到位让7-Zip用上6大现代压缩算法
  • 抖音批量下载工具完全上手手册:5 步用 douyin-downloader 建起无水印视频内容库
  • AXPhotoViewer 网络集成详解:SDWebImage、Kingfisher、Nuke 等 6 大方案对比与选型
  • 微信聊天记录导出终极指南:如何让每一段对话永久留痕?
  • FastCSV 读取 CSV 的 3 种记录类型:CsvRecord、NamedCsvRecord 与 StringArray,一篇搞懂怎么选
  • MobaXterm-keygen 使用指南:三步生成 Custom.mxtpro 注册文件,解锁专业版全部功能
  • 2026年贵阳人工养殖黄鳝基地 解决选场困惑 五家专业参考 - 滚动商讯
  • 温州小程序App制作公司怎么选?2026年十家高口碑服务商评测与实力解析 - 软件测评师
  • 新手养宠避坑指南,线下场地积累真实养犬认知 - 北京同城宠物基地
  • MAC地址每台设备的身份证号
  • 抖音无水印批量下载器完整实战指南
  • 基于SpringBoot的同人创作与分享平台系统(毕业设计项目源码+文档)
  • QSYM 核心架构全解析:从 PIN 插桩到 Z3 求解
  • SmartBugs 跨平台安装终极指南:Windows/macOS/Linux 避坑全攻略
  • 5步搭好免费自托管游戏串流服务:Sunshine 从安装到畅玩全指南
  • SCOOP多机部署实战:用SSH与hostfile构建分布式集群
  • iPhone远程控制安卓手机:Scrcpy-iOS跨平台远程控制从零上手
  • 2026单轴转台选购指南:精度、传动与厂家盘点
  • MiniMax Music 3 环境搭建教程:SGLang-Omni 部署与 API 调用从零开始
  • 【b站咸虾米】3 Vue CLI脚手架 2021最新Vue从基础到实例高级_vue2_vuecli脚手架博客案例
  • GetQzonehistory 实测:3分钟一键导出QQ空间全部说说,永久封存你的青春记忆
  • 2026年有医疗认证的UE Electronic相关企业选购参考榜 - 滚动商讯
  • 自指递归结构驱动认知流形可穿越虫洞形成机制(SH9认知几何学框架深化研究版)——算子表示、场方程、拓扑动力学与可验证实验方案
  • 2026 八月最新唐山下水道疏通上门维修冻管处理测漏异物打捞商家盘点 - 启航优客
  • 着眼长久陪伴,挑选能够共度漫长时光的家庭幼犬 - 北京同城宠物基地
  • 内蒙古旅行不想跟购物团?这7位正规持证导游,建议先收藏 - 纯玩旅游分享
  • 安卓文件同步工具实战全攻略:一台手机一台电脑,让数据直连互传不再求人