最近遇到一个bug,说在setting界面下home key 失灵
这么奇怪的问题先看log:
结果发现有个奇怪的log就是有来电
12-07 13:05:54.818 2460 3526 I WindowManager: Ignoring HOME; there's a ringing incoming call.
12-07 13:05:55.326 2460 3526 D Telecom : [TELECOM][TelecomServiceImpl]: isPrivilegedDialerCalling = android
12-07 13:05:55.330 2460 3526 I WindowManager: Ignoring HOME; there's a ringing incoming call.
12-07 13:05:55.735 4017 4017 D wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
12-07 13:05:55.784 2460 3526 D Telecom : [TELECOM][TelecomServiceImpl]: isPrivilegedDialerCalling = android
12-07 13:05:55.788 2460 3526 I WindowManager: Ignoring HOME; there's a ringing incoming call.
12-07 13:05:56.187 2460 3526 D Telecom : [TELECOM][TelecomServiceImpl]: isPrivilegedDialerCalling = android
12-07 13:05:56.192 2460 3526 I WindowManager: Ignoring HOME; there's a ringing incoming call.
12-07 13:05:56.384 0 0 I : CM36283--- NO calibration data, Factory branch , NO default config
这个WindowManager: Ignoring HOME; there's a ringing incoming call在哪里呢,就在上一片文章的最后几个函数里
public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags) 里的
if (keyCode == KeyEvent.KEYCODE_HOME) {
TelecomManager telecomManager = getTelecommService();
if (telecomManager != null && telecomManager.isRinging()) {
Log.i(TAG, "Ignoring HOME; there's a ringing incoming call.");
return -1;
}
}
所以对照起来发现就是在有来电的情况下,本来home key就不灵,这个问题在于来电没有显示在界面上,所以误认为是home key失灵