函數功能是在通話狀態改變時候,更新螢幕的
一、首先判定當前是否可以出現通話菜單
1,如果電話是空閑狀態,不可以出現菜單
2,如果有來電
2.1 如果當前正在通話而且沒有等待的電話,可以彈出通話菜單
2.2 否則,不能快顯功能表
二、如果是多方通話,更新會議面板
三、根據當前通話狀態,更新CallCard,就是螢幕中間顯示頭像那一塊。
四、是否顯示DTMF面板(通話過程中的那個撥號面板,如查話費時候,供你按人工提示輸入數位那個面板)
1,如果當前是響鈴狀態,不關閉撥號面板,但是清空裡面可能是上一個通話的數字
2,如果當前是豎屏模式,並且在通話狀態下,可以顯示撥號面板
五,更新等待接聽介面,如果有來電則轉到等待接聽介面(就是來電的時候那個介面)
六,更新menuButtonHint 在string.xml裡面有定義 <string name="menuButtonHint" msgid="4853215496220101699">"按 MENU 可以選擇通話選項。"</string>
部分代碼如下
if (mInCallMenu != null) {
// TODO: do this only if the menu is visible!
if (VDBG) log("- updateScreen: updating menu items...");
boolean okToShowMenu = mInCallMenu.updateItems(mPhone);
if (!okToShowMenu) {
// Uh oh: we were only trying to update the state of the
// menu items, but the logic in InCallMenu.updateItems()
// just decided the menu shouldn't be visible at all!
// (That's probably means that the call ended
// asynchronously while the menu was up.)
//
// So take the menu down ASAP.
if (VDBG) log("- updateScreen: Tried to update menu; now need to dismiss!");
// dismissMenu() has no effect if the menu is already closed.
dismissMenu(true); // dismissImmediate = true
}
}
if (mInCallScreenMode == InCallScreenMode.MANAGE_CONFERENCE) {
if (VDBG) log("- updateScreen: manage conference mode (NOT updating in-call UI)...");
updateManageConferencePanelIfNecessary();
return;
} else if (mInCallScreenMode == InCallScreenMode.CALL_ENDED) {
if (VDBG) log("- updateScreen: call ended state (NOT updating in-call UI)...");
return;
}
if (VDBG) log("- updateScreen: updating the in-call UI...");
mCallCard.updateState(mPhone);
updateDialpadVisibility();
updateOnscreenAnswerUi();
updateMenuButtonHint();