默认电量低于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; + } |
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 11:38
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.