yam
yam
论坛版主
论坛版主
  • 社区居民
  • 优秀斑竹
  • VIP会员
  • 荣誉会员
阅读:7423回复:4

Android 8.1 平台去屏保 不休眠

楼主#
更多 发布于:2019-07-09 15:12
测试平台:Amlogic S905X2  8.1
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
old mode 100644
new mode 100755
index 3d75785..345edab
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1883,7 +1883,7 @@
     <bool name="config_dreamsSupported">true</bool>
 
     <!-- If supported, are dreams enabled? (by default) -->
-    <bool name="config_dreamsEnabledByDefault">true</bool>
+    <bool name="config_dreamsEnabledByDefault">false</bool>
     <!-- If supported and enabled, are dreams activated when docked? (by default) -->
     <bool name="config_dreamsActivatedOnDockByDefault">true</bool>
     <!-- If supported and enabled, are dreams activated when asleep and charging? (by default) -->
@@ -1988,7 +1988,7 @@
          This value must be greater than zero, otherwise the device will immediately
          fall asleep again as soon as it is awoken.
     -->
-    <integer name="config_minimumScreenOffTimeout">10000</integer>
+    <integer name="config_minimumScreenOffTimeout">-1</integer>
 
     <!-- User activity timeout: Maximum screen dim duration in milliseconds.
 
-
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
old mode 100644
new mode 100755
index f84b20c..ac5868d
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -2053,6 +2053,9 @@ public final class PowerManagerService extends SystemService
         if (sleepTimeout >= 0) {
             timeout = Math.min(timeout, sleepTimeout);
         }
+ if (mMinimumScreenOffTimeoutConfig < 0 ) {
+ return mMaximumScreenOffTimeoutFromDeviceAdmin;
+ }
         return Math.max(timeout, mMinimumScreenOffTimeoutConfig);
     }
yam
yam
论坛版主
论坛版主
  • 社区居民
  • 优秀斑竹
  • VIP会员
  • 荣誉会员
沙发#
发布于:2019-07-09 15:13
补丁取之于网络,用之于网络。
板凳#
发布于:2019-07-09 16:06
不错,不积跬步无以至千里,不积小流无以成江海。大家一起积累知识经验,早日成为行业大佬
[url]http://190.lsal.cn/195/1329.gif?0728100424873[/url]
地板#
发布于:2019-07-09 16:12
占楼.
[url]http://190.lsal.cn/195/1329.gif?0728100424873[/url]
4楼#
发布于:2019-07-09 16:40
好。每日学习
If you have nothing to lose, then you can do anything.
游客

返回顶部