[RK3288][Android6.0] 调试笔记 --- 移除低电量警告显示对话框

时间:2022-12-28 23:25:56

Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

当低电量时会有如下图提示:
[RK3288][Android6.0] 调试笔记 --- 移除低电量警告显示对话框

如果是定制Launcher的话可能需要移除对话框

解决方法:

kris@:~/rk3288/frameworks/base$ g df packages/SystemUI/src/com/android/systemui/power/PowerUI.java
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
index 9459740..30cbdf2 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java
@@ -198,7 +198,8 @@ public class PowerUI extends SystemUI {
&& bucket < 0) {
// only play SFX when the dialog comes up or the bucket changes
final boolean playSound = bucket != oldBucket || oldPlugged;
- mWarnings.showLowBatteryWarning(playSound);
+ /*Kris, 170801, disable to display battery low dialog.*/
+ //mWarnings.showLowBatteryWarning(playSound);
} else if (plugged || (bucket > oldBucket && bucket > 0)) {
mWarnings.dismissLowBatteryWarning();
} else {

参考:
[IMX6DL][Android4.4] 电池低电量告警提示