当用户触屏后,InputReader 从驱动读取一个输入事件加入到队列,InputDispatcher 从队列中读取一个输入事件准备分发。如果该输入事件是一个触摸事件...

Continue Reading ...

某个 App 启动后显示用户协议相关 Dialog。这时不相应 touch event。复现后,回到 Home,重新进入也不恢复。

Continue Reading ...

InputChannel 是分发 input 事件的通道,driver 产生 input 事件,发送到 system_server 后通过 socket 发送到 app 进程。每次创建 window 时会创建一对 InputChannel 对象...

Continue Reading ...

SystemServer 是 system_server 进程的 Java 层入口,main() 方法中创建 SystemServer 对象,并执行 run()。run() 方法中创建 SystemServiceManager 对象...

Continue Reading ...

SystemService 是在 system_server 进程中执行,因此权限也比较高。虽然可以在 API 中做一些访问控制,但是因为有反射、动态代理等技术的存在,在 SystemService 的实际方法实现中做访问控制是必要的...

Continue Reading ...

NavigationBar 和 StatusBar 都属于 SystemBar,也叫做 decor,就是说给 App 装饰的意思。SystemBar 是在 beginLayoutLw() 方法中布局...

Continue Reading ...

默认情况下,如果系统版本是 Android 8.0 以上,则收不到。如果是 Android 7.0,需要设置 directBootAware 为 true。如果想在 Android 8.0 以上版本中收到...

Continue Reading ...

目前 AOSP 中有三个主题,分别是 themes.xml、themes_holo.xml、themes_materials.xml。其中 themes.xml 是 Android 4.0 以前使用的默认主题,themes_holo.xml 是 Android 4.0 ~ Android 4.4 使用的默认主题,themes_materials.xml 是 Android 5.0 之后使用的默认主题...

Continue Reading ...

输入法弹出入口有 TextView、SearchView、NumberPicker 等。这几个控件都是调用 InputMethodManager 的 showSoftInput() 方法弹出的...

Continue Reading ...