Android4.4默认永不休眠

frameworks/base/packages/SettingsProvider/res/values$ vim defaults.xml

600000

+1728000000

/frameworks/base/services/java/com/android/server/power$ vim PowerManagerService.java 
 

 private int getScreenOffTimeoutLocked() {
        int timeout = mScreenOffTimeoutSetting;
    +  int nosleep;
        if (isMaximumScreenOffTimeoutFromDeviceAdminEnforcedLocked()) {
            timeout = Math.min(timeout, mMaximumScreenOffTimeoutFromDeviceAdmin);
        }
        if (mUserActivityTimeoutOverrideFromWindowManager >= 0) {
            timeout = (int)Math.min(timeout, mUserActivityTimeoutOverrideFromWindowManager);
        }
     +    nosleep = mScreenOffTimeoutSetting;
               + if( nosleep >= 1728000000 ){
              +          Log.d("YUANDAN", " mScreenOffTimeoutSetting=" + mScreenOffTimeoutSetting + " +mMaximumScreenOffTimeoutFromDeviceAdmin= " +mMaximumScreenOffTimeoutFromDeviceAdmin);
        +  nosleep = mMaximumScreenOffTimeoutFromDeviceAdmin;
            +      return Math.max(nosleep,mMaximumScreenOffTimeoutFromDeviceAdmin);

             +   }
        return Math.max(timeout, MINIMUM_SCREEN_OFF_TIMEOUT);
    }

   补充:Settings中休眠选项中nerver对应的数值也要更改为172800000
 

你可能感兴趣的:(编程语言)