当前位置:网站首页>Input system learning ----- inputfilter
Input system learning ----- inputfilter
2022-06-22 02:06:00 【aaajj】
Android There is 2 individual InputFilter, What we usually find is text.InputFilter,
Here we are talking about input dependent view.InputFilter,
Input In the distribution process, it is necessary to determine whether or not InputFilter, If it's set up ,input The process will come to InputFilter in ,
see InputFilter The definition of , I inherited it binder Of stub object , It seems that it can be used as binder The service object transfers data in the process .
92 * @hide 93 */ 94public abstract class InputFilter extends IInputFilter.Stub {
to glance at IInputFilter The definition of ,
frameworks/base/core/java/android/view/IInputFilter.aidl
17package android.view; 18 19import android.view.IInputFilterHost; 20import android.view.InputEvent; 21 22/** 23 * Interface for implementing an filter which observes and 24 * potentially transforms the input event stream in the system. 25 * 26 * @hide 27 */ 28oneway interface IInputFilter { 29 void install(IInputFilterHost host); 30 void uninstall(); 31 void filterInputEvent(in InputEvent event, int policyFlags); 32}
It can be seen that ,InputEvent,MotionEvent Objects can be serialized and passed through binder delivery .
InputFilter It defines handler For asynchronous processing , Compile the... Of the receiving system input event , Avoid systematic input The process is blocked , We can also call filterInputEvent Method to actively inject an event ,
149 final public void filterInputEvent(InputEvent event, int policyFlags) { 150 mH.obtainMessage(MSG_INPUT_EVENT, policyFlags, 0, event).sendToTarget(); 151 }
handler The definition of
213 private final class H extends Handler { 214 public H(Looper looper) { 215 super(looper); 216 } 217 218 @Override 219 public void handleMessage(Message msg) { 220 switch (msg.what) { 221 case MSG_INSTALL: 222 mHost = (IInputFilterHost) msg.obj; 223 if (mInboundInputEventConsistencyVerifier != null) { 224 mInboundInputEventConsistencyVerifier.reset(); 225 } 226 if (mOutboundInputEventConsistencyVerifier != null) { 227 mOutboundInputEventConsistencyVerifier.reset(); 228 } 229 onInstalled(); 230 break; 231 232 case MSG_UNINSTALL: 233 try { 234 onUninstalled(); 235 } finally { 236 mHost = null; 237 } 238 break; 239 240 case MSG_INPUT_EVENT: { 241 final InputEvent event = (InputEvent)msg.obj; 242 try { 243 if (mInboundInputEventConsistencyVerifier != null) { 244 mInboundInputEventConsistencyVerifier.onInputEvent(event, 0); 245 } 246 onInputEvent(event, msg.arg1); 247 } finally { 248 event.recycle(); 249 } 250 break; 251 } 252 } 253 } 254 } 255}
Reference material
Android Auxiliary function --- Global gesture zoom - You know
边栏推荐
- Ansible Inventory 主机清单
- 2020 csp-j1 csp-s1 first round preliminary round answer analysis and summary, video, etc
- 新员工入职,了解工作信息
- LeetCode+ 46 - 50
- 微信小程序影视评论交流平台系统毕业设计毕设(5)任务书
- Efficient packet processing system based on dpdk
- Learn to crawl steadily 08 - detailed explanation of the use method of selenium
- Recommended by Ali, Tencent and Baidu software testing engineers - waterfall model of software testing model
- What is your understanding of interface testing?
- excel常用快捷鍵excel快捷鍵匯總
猜你喜欢

digital signal processing

GAMES-101-个人总结归纳-Transformation

Chapter 08 handwritten digit recognition based on knowledge base matlab deep learning application practice
![[chapter 04 answer sheet recognition based on Hough change]](/img/2a/83ac4875ec7f61e28eb81175d35142.png)
[chapter 04 answer sheet recognition based on Hough change]

通信尾纤常用尾纤简介

Chrome browser cancel input box to record form input history
![[chapter 02 weight adaptive image denoising technology based on Morphology - full system matlab intelligent driving in-depth learning]](/img/65/c9ba18ffd37f84c3ca399507625c90.png)
[chapter 02 weight adaptive image denoising technology based on Morphology - full system matlab intelligent driving in-depth learning]

基于DPDK的高效包处理系统

Chapter 18 build a general video processing tool based on GUI matlab application GUI implementation

LeetCode+ 46 - 50
随机推荐
LeetCode 41 - 45 动态规划专题
Test case design method -- cause and effect diagram method
[amd comprehensive job search experience sharing 618]
Common shortcut keys in Excel summary of shortcut keys in Excel
acwing 836. Merge sets (merge sets)
[Chapter 15 wavelet based image compression technology deep learning machine learning image processing application matlab.]
音视频学习路线及学习资料推荐
Wechat applet film and television review and exchange platform system graduation design completion (8) graduation design thesis template
excel常用快捷键excel快捷键汇总
Wechat applet Film & TV Review Exchange Platform System Graduation Design (4) Rapport d'ouverture
LeetCode+ 46 - 50
微信小程序影視評論交流平臺系統畢業設計畢設(4)開題報告
Completion of graduation design of wechat small program film and television review and exchange platform system (4) opening report
Mathematical knowledge in the first round of noip preliminary round csp-j1 csp-s1 Sinorgchem (III)
Appium面试题
程序员常用的组件、框架、开发工具下载链接大全
Chapter 18 build a general video processing tool based on GUI matlab application GUI implementation
acwing 836. 合并集合 (并查集)
Leetcode 41 - 45 dynamic planning topic
digital signal processing