Browsed by
月份:2017年3月

Android M shutdown流程

Android M shutdown流程

第一部分:关机事件的捕获

1,PhoneWindowManager捕获POWER按键

  1. public int interceptKeyBeforeQueueing(KeyEvent event, int policyFlags) {
  2. ...
  3. case KeyEvent.KEYCODE_POWER: {
  4. ...
  5. result &= ~ACTION_PASS_TO_USER;
  6. isWakeKey = false; // wake-up will be handled separately
  7. if (down) {
  8. interceptPowerKeyDown(event, interactive);
  9. } else {
  10. time_record =time_now; //Letv-U4 UFO-2382 :20160812
  11. interceptPowerKeyUp(event, interactive, canceled);
  12. }
  13. break;
  14. }
  15. ...

Read More Read More

TOP