嵌入式爱好者

OK3588Android12系统低电量关机

2023-10-31 14:08| 发布者: whl| 查看: 125| 评论: 0

类目: RK3588系列产品  >  Android     文档编号: 1187

默认电量低于15%会自动关机,如果想要改为低于10%关机,可以做如下修改:
--- a/frameworks/base/services/core/java/com/android/server/BatteryService.java
+++ b/frameworks/base/services/core/java/com/android/server/BatteryService.java
@@ -370,9 +370,13 @@ public final class BatteryService extends SystemService {
     }

     private boolean shouldShutdownLocked() {
-        if (mHealthInfo2p1.batteryCapacityLevel != BatteryCapacityLevel.UNSUPPORTED) {
- return (mHealthInfo2p1.batteryCapacityLevel == BatteryCapacityLevel.CRITICAL);
- }
+       if(mHealthInfo.batteryLevel < 15 && !isPoweredLocked(BatteryManager.BATTERY_PLUGGED_ANY)) {
+               return true;
+       }

已解决

未解决

只是看看

最新评论

QQ|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )

GMT+8, 2024-11-22 11:38

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

返回顶部