• I.MX6 android 移除shutdown功能


    /************************************************************************
     *                    I.MX6 android 移除shutdown功能
     * 说明:
     *     有时候,我们可能会只是不需要android中的shutdown功能。
     *
     *                                     2016-3-17 深圳 南山平山村 曾剑锋
     ***********************************************************************/
    
    cat frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
        ......
        public class PhoneWindowManager implements WindowManagerPolicy {
            ......
            private final Runnable mPowerLongPress = new Runnable() {
                @Override
                public void run() {
                    // The context isn't read
                    if (mLongPressOnPowerBehavior < 0) {
                        mLongPressOnPowerBehavior = mContext.getResources().getInteger(
                                com.android.internal.R.integer.config_longPressOnPowerBehavior);
                    }
                    int resolvedBehavior = mLongPressOnPowerBehavior;
                    if (FactoryTest.isLongPressOnPowerOffEnabled()) {
                        resolvedBehavior = LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM;
                    }
        
                    switch (resolvedBehavior) {
                    case LONG_PRESS_POWER_NOTHING:
                        break;
                    case LONG_PRESS_POWER_GLOBAL_ACTIONS:
                        mPowerKeyHandled = true;
                        if (!performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false)) {
                            performAuditoryFeedbackForAccessibilityIfNeed();
                        }
                        sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                        // modify by zengjf 2016-3-17
                        //showGlobalActionsDialog();
                        //mWindowManagerFuncs.shutdown(resolvedBehavior == LONG_PRESS_POWER_SHUT_OFF);
                        break;
                    case LONG_PRESS_POWER_SHUT_OFF:
                    case LONG_PRESS_POWER_SHUT_OFF_NO_CONFIRM:
                        mPowerKeyHandled = true;
                        performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
                        sendCloseSystemWindows(SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS);
                        mWindowManagerFuncs.shutdown(resolvedBehavior == LONG_PRESS_POWER_SHUT_OFF);
                        break;
                    }
                }
            };
            ......
        }   
        ......
  • 相关阅读:
    C#跨窗体操作
    搞IT的不如去养鸡养猪了
    C# 委托实例(跨窗体操作控件)
    FastReport 自定义页长
    SQL 根据一个表更新另一个表的内容
    Delphi中用ADOQuery实现主从表的例子(转)
    旅行的意义
    嘉州影院的网址
    纯粹的人
    Delphi中流的使用:压缩与解压缩(TCompressionStream、TDecompressionStream)
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/5287683.html
Copyright © 2020-2023  润新知