InCallScreen.java/updateScreen()分析

來源:互聯網
上載者:User

函數功能是在通話狀態改變時候,更新螢幕的

一、首先判定當前是否可以出現通話菜單

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();

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.