美文网首页
按键 | Power按键流程分析(简易流程)

按键 | Power按键流程分析(简易流程)

作者: 力卉编程 | 来源:发表于2019-12-28 20:46 被阅读0次

从InputManagerService分析我们知道,当按下手机的Power键之后,按键事件会传到InputDispatcher 的notifyKey 方法,然后调用到调用了NativeInputManager的interceptKeyBeforeQueueing函数,最终在这个函数中会调用到PhoneWindowManager中的interceptKeyBeforeQueueing函数,以上主要属于InputManagerService的范畴,Power按键流程我们从PhoneWindowManager 的interceptKeyBeforeQueueing 方法开始分析。

Power按键流程总结

1.亮屏 down
长按 弹出关闭重启对话框
短按 不做处理
亮屏 up
长按 不做处理
短按 调用goToSleep休眠系统

  1. 灭屏 down
    调用wakeup 唤醒系统
    灭屏 up
    不做处理

完~~
文 | 力卉编程

相关文章

网友评论

      本文标题:按键 | Power按键流程分析(简易流程)

      本文链接:https://www.haomeiwen.com/subject/eqqeoctx.html