导航键或手势导航注入事件
Posted xhBruce
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了导航键或手势导航注入事件相关的知识,希望对你有一定的参考价值。
导航键或手势导航注入事件
SystemUI注入
先搜一波 injectInputEvent :
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/EdgeBackGestureHandler.java
frameworks/base/packages/SystemUI/src/com/android/systemui/accessibility/SystemActions.java
KeyEvent.KEYCODE_HOME: 3
KeyEvent.KEYCODE_BACK: 4
KeyEvent.KEYCODE_APP_SWITCH: 187
public static final int INJECT_INPUT_EVENT_MODE_ASYNC = 0; // see InputDispatcher.h
InputManagerService中调用
frameworks/base/services/core/java/com/android/server/input/InputManagerService.java
- INJECT_INPUT_EVENT_MODE_ASYNC 继续执行
int FLAG_DISABLE_KEY_REPEAT = 0x08000000;
InputDispatcher::injectInputEvent 调用
- 日志injectInputEvent中
Binder.getCallingPid()
、Binder.getCallingUid()
FLAG_DISABLE_KEY_REPEAT & POLICY_FLAG_FILTERED = 0x08000000 & 0x04000000 = 0;
进入interceptKeyBeforeQueueing
mLooper->wake()
唤醒InputDispatcher
// Indicates that the input event has passed through an input filter.
POLICY_FLAG_FILTERED = 0x04000000,
以上是关于导航键或手势导航注入事件的主要内容,如果未能解决你的问题,请参考以下文章