Android14 WMS-IWindow介绍

devtools/2024/10/18 10:19:02/

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.ppmy.cn/devtools/45283.html

相关文章

Idea工具的使用技巧与常见问题解决方案

一、使用技巧 1、启动微服务配置 如上图&#xff0c;在编辑配置选项&#xff0c;将对应的启动入口类加进去&#xff0c; 增加jvm启动参数&#xff0c; 比如&#xff1a; -Denvuat 或者 -Denvuat -Dfile.encodingUTF-8 启动配置可能不是-Denvuat&#xff0c;这个自己看代…

详解 Scala 的模式匹配

一、基本语法 Scala 中的模式匹配类似于 Java 中的 switch 语法&#xff0c;但是功能更强大 /**[var a / def func() ] var_name match {case value1 > statement1case value2 > statement2case value3 > statement3case _ > defaultOP} */ object TestMatchCase…

【kubernetes】关于k8s集群如何将pod调度到指定node节点(亲和与反亲和等)

目录 一、调度约束 1.1K8S的 List-Watch 机制 ⭐⭐⭐⭐⭐ 1.1.1Pod 启动典型创建过程 二、调度过程 2.1Predicate&#xff08;预选策略&#xff09; 常见的算法 2.2priorities&#xff08;优选策略&#xff09;常见的算法 三、k8s将pod调度到指定node的方法 3.1指定…

Lua的几个特殊用法

&#xff1a;/.的区别 详细可以参考https://zhuanlan.zhihu.com/p/651619116。最重要的不同就是传递默认参数self。 通过.调用函数&#xff0c;传递self实例 通过 &#xff1a; 调用函数&#xff0c;传递self (不需要显示的传递self参数&#xff0c;默认就会传递&#xff0c;但…

RedisSearch与Elasticsearch:技术对比与选择指南

码到三十五 &#xff1a; 个人主页 数据时代&#xff0c;全文搜索已经成为许多应用程序中不可或缺的一部分。RedisSearch和Elasticsearch是两个流行的搜索解决方案&#xff0c;它们各自具有独特的特点和优势。本文简单探讨一些RedisSearch和Elasticsearch之间的技术差异。 目录…

Java内存模型----JMM

Java内存模型 1. 前言2. 主内存与工作内存3. JMM解决什么问题&#xff1f;4. JMM内存交互5. Happens-Before1. 程序的顺序性规则2. volatile 变量规则3. 管程中锁的规则4. 线程启动规则5. 线程join规则6. 其他规则 1. 前言 内存模型这个概念。我们可以理解为&#xff1a; 在特定…

LeetCode374猜数字大小

题目描述 我们正在玩猜数字游戏。猜数字游戏的规则如下&#xff1a;我会从 1 到 n 随机选择一个数字。 请你猜选出的是哪个数字。如果你猜错了&#xff0c;我会告诉你&#xff0c;我选出的数字比你猜测的数字大了还是小了。你可以通过调用一个预先定义好的接口 int guess(int n…

OpenAI 的 GPT-4o 是目前最先进的人工智能模型!如何在工作或日常生活中高效利用它?

OpenAI 的 GPT-4o 是目前最先进的人工智能模型&#xff01;如何在工作或日常生活中高效利用它&#xff1f; 博主猫头虎的技术世界 &#x1f31f; 欢迎来到猫头虎的博客 — 探索技术的无限可能&#xff01; 专栏链接&#xff1a; &#x1f517; 精选专栏&#xff1a; 《面试题大…