Android隱藏虛擬按鍵,關閉開機動畫、開機聲音


/***********************************************************************
 *               Android隱藏虛擬按鍵,關閉開機動畫、開機聲音
 * 聲明:
 *     有時候,我們可能會希望隱藏掉android中的虛擬按鍵,當然,那個
 * Android的開機動畫,有時候也是挺討人厭的,也是可以隱藏的。
 *
 *                                  2016-1-7 深圳 南山平山村 曾劍鋒
 **********************************************************************/

一、參考文檔:
    1. android4.2&android4.3去掉虛擬按鍵
        http://blog.csdn.net/bzw073/article/details/22916505
    2. android4.0.3 修改啟動動畫和開機聲音
        http://www.cnblogs.com/jqyp/archive/2012/03/07/2383973.html

二、虛擬按鍵解決方法:
    隱藏全部虛擬按鍵,只需要在build.prop中增加qemu.hw.mainkeys=1即可。

三、關閉開機動畫、開機聲音解決方法:
    1. cat frameworks/base/cmds/bootanimation/bootanimation_main.cpp
        ......
        int main(int argc, char** argv)
        {
        #if defined(HAVE_PTHREADS)
            setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY);
        #endif
        
            char value[PROPERTY_VALUE_MAX];
            property_get("debug.sf.nobootanimation", value, "0");
            int noBootAnimation = atoi(value);
            ALOGI_IF(noBootAnimation,  "boot animation disabled");
            if (!noBootAnimation) {
        
                sp<ProcessState> proc(ProcessState::self());
                ProcessState::self()->startThreadPool();
        
                // create the boot animation object
                sp<BootAnimation> boot = new BootAnimation();
        
                IPCThreadState::self()->joinThreadPool();
        
            }
            return 0;
        }
        ......
    2. 從上面可知只需要在在build.prop中增加debug.sf.nobootanimation=1即可。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM