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即可。

 

posted on 2016-01-07 15:08  zengjf  阅读(2684)  评论(0编辑  收藏  举报

导航