MTK 永不熄屏

步骤一:

源码/frameworks/base/packages/SettingsProvider/res/values/defaults.xml

修改<integername="def_screen_off_timeout">6000</integer>为:

<integername="def_screen_off_timeout">-1</integer>

 

步骤二:

源码/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java

修改getScreenOffTimeoutLocked()函数为:

private int getScreenOffTimeoutLocked(intsleepTimeout) {
        int nosleep;
       int timeout = mScreenOffTimeoutSetting;
        if(isMaximumScreenOffTimeoutFromDeviceAdminEnforcedLocked()) {
            timeout = Math.min(timeout,mMaximumScreenOffTimeoutFromDeviceAdmin);
        }
        if(mUserActivityTimeoutOverrideFromWindowManager >= 0) {
            timeout = (int)Math.min(timeout,mUserActivityTimeoutOverrideFromWindowManager);
        }
        if (sleepTimeout >= 0) {
            timeout = Math.min(timeout,sleepTimeout);
        }
       nosleep = mScreenOffTimeoutSetting;
       if(nosleep <0)
       {
           nosleep = mMaximumScreenOffTimeoutFromDeviceAdmin;
           return Math.max(nosleep,mMaximumScreenOffTimeoutFromDeviceAdmin);
       }
        return Math.max(timeout,mMinimumScreenOffTimeoutConfig);
    }

 

    原文作者:PowerManagerService
    原文地址: http://www.cnblogs.com/zxouxuewei/p/8127858.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞