不積跬步無以至千里
一.前摘
其實這裏是原生的設計,故意在鎖屏的來電界面,不讓執行home鍵的流程(這裏應該是啓動launcher的主activity),因此這裏我們要針對它的邏輯進行修改。
二.修改
代碼路徑:
app/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
private boolean onHomeTouch(View v, MotionEvent event) {
if (mHomeBlockedThisTouch && event.getActionMasked() != MotionEvent.ACTION_DOWN) {
return true;
}
// If an incoming call is ringing, HOME is totally disabled.
// (The user is already on the InCallUI at this point,
// and his ONLY options are to answer or reject the call.)
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mHomeBlockedThisTouch = false;
//修改的地方爲把關於判斷此時是否爲處於接打電話,把這塊邏輯去掉,就可以了
// TelecomManager telecomManager =
// getContext().getSystemService(TelecomManager.class);
//