zoukankan      html  css  js  c++  java
  • 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即可。
  • 相关阅读:
    IOS cocos2d笔记1
    [转] 函数调用的栈分配
    iOS 静态类库项目的建立与使用
    Brew 编译mod错误Error: L6265E: Non-RWPI Section libspace.o(.bss) cannot be assigned to PI Exec region ER_ZI
    [LeetCode]7、Reverse Integer
    [LeetCode]1、Two Sum
    java学习路线和知识图谱
    《Java编程思想》第十一章 持有对象
    《Java编程思想》第十章 内部类
    《Java编程思想》第十三章 字符串
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/5109933.html
Copyright © 2011-2022 走看看