线程提醒电量问题调试完成

This commit is contained in:
2025-12-24 21:07:54 +08:00
parent 80da7677f8
commit f4a485f1ff
5 changed files with 60 additions and 57 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Wed Dec 24 12:16:27 GMT 2025 #Wed Dec 24 13:05:44 GMT 2025
stageCount=29 stageCount=29
libraryProject= libraryProject=
baseVersion=15.14 baseVersion=15.14
publishVersion=15.14.28 publishVersion=15.14.28
buildCount=97 buildCount=103
baseBetaVersion=15.14.29 baseBetaVersion=15.14.29

View File

@@ -42,7 +42,7 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
int reminderIntervalTime = 5000; // 铃声提醒间隔ms int reminderIntervalTime = 5000; // 铃声提醒间隔ms
// 电量状态 // 电量状态
boolean isCharging = false; // 是否充电 boolean isCharging = false; // 是否充电
int currentBatteryValue = INVALID_BATTERY; // 当前电池电量(统一命名,替代原 currentValue //int currentBatteryValue = INVALID_BATTERY; // 当前电池电量(统一命名,替代原 currentValue
// 电量检测配置 // 电量检测配置
int batteryDetectInterval = 2000; // 电量检测间隔ms适配 RemindThread int batteryDetectInterval = 2000; // 电量检测间隔ms适配 RemindThread
// 相框配置 // 相框配置
@@ -57,7 +57,7 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
setEnableUsageReminder(false); setEnableUsageReminder(false);
setReminderIntervalTime(5000); setReminderIntervalTime(5000);
setBatteryDetectInterval(1000); // 默认检测间隔1秒 setBatteryDetectInterval(1000); // 默认检测间隔1秒
setCurrentBatteryValue(INVALID_BATTERY); // 初始化无效电量标识 //setCurrentBatteryValue(INVALID_BATTERY); // 初始化无效电量标识
setDefaultFrameWidth(DEFAULT_FRAME_WIDTH); // 初始化默认相框宽度 setDefaultFrameWidth(DEFAULT_FRAME_WIDTH); // 初始化默认相框宽度
setDefaultFrameHeight(DEFAULT_FRAME_HEIGHT); // 初始化默认相框高度 setDefaultFrameHeight(DEFAULT_FRAME_HEIGHT); // 初始化默认相框高度
LogUtils.d(TAG, "AppConfigBean() 初始化默认配置完成"); LogUtils.d(TAG, "AppConfigBean() 初始化默认配置完成");
@@ -69,20 +69,20 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
* 设置当前电池电量Receiver 监听电池变化时调用) * 设置当前电池电量Receiver 监听电池变化时调用)
* @param currentBatteryValue 当前电量0-100 * @param currentBatteryValue 当前电量0-100
*/ */
public void setCurrentBatteryValue(int currentBatteryValue) { // public void setCurrentBatteryValue(int currentBatteryValue) {
this.currentBatteryValue = (currentBatteryValue >= BATTERY_MIN && currentBatteryValue <= BATTERY_MAX) // this.currentBatteryValue = (currentBatteryValue >= BATTERY_MIN && currentBatteryValue <= BATTERY_MAX)
? currentBatteryValue : INVALID_BATTERY; // ? currentBatteryValue : INVALID_BATTERY;
LogUtils.d(TAG, String.format("setCurrentBatteryValue() 执行 | 最终电量=%d | 输入值=%d", // LogUtils.d(TAG, String.format("setCurrentBatteryValue() 执行 | 最终电量=%d | 输入值=%d",
this.currentBatteryValue, currentBatteryValue)); // this.currentBatteryValue, currentBatteryValue));
} // }
//
/** // /**
* 获取当前电池电量RemindThread 同步配置时调用) // * 获取当前电池电量RemindThread 同步配置时调用)
* @return 当前电量0-100 或 INVALID_BATTERY // * @return 当前电量0-100 或 INVALID_BATTERY
*/ // */
public int getCurrentBatteryValue() { // public int getCurrentBatteryValue() {
return currentBatteryValue; // return currentBatteryValue;
} // }
// --------------- 铃声提醒配置相关 --------------- // --------------- 铃声提醒配置相关 ---------------
/** /**
@@ -222,8 +222,8 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
jsonWriter.name("reminderIntervalTime").value(getReminderIntervalTime()); jsonWriter.name("reminderIntervalTime").value(getReminderIntervalTime());
jsonWriter.name("isCharging").value(isCharging()); jsonWriter.name("isCharging").value(isCharging());
// 兼容旧字段 currentValue同步新字段 currentBatteryValue // 兼容旧字段 currentValue同步新字段 currentBatteryValue
jsonWriter.name("currentBatteryValue").value(getCurrentBatteryValue()); // jsonWriter.name("currentBatteryValue").value(getCurrentBatteryValue());
jsonWriter.name("currentValue").value(getCurrentBatteryValue()); // jsonWriter.name("currentValue").value(getCurrentBatteryValue());
// 新增字段序列化(检测配置) // 新增字段序列化(检测配置)
jsonWriter.name("batteryDetectInterval").value(getBatteryDetectInterval()); jsonWriter.name("batteryDetectInterval").value(getBatteryDetectInterval());
// 新增字段序列化(相框配置) // 新增字段序列化(相框配置)
@@ -257,15 +257,17 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
} else if (name.equals("isCharging")) { } else if (name.equals("isCharging")) {
bean.setIsCharging(jsonReader.nextBoolean()); bean.setIsCharging(jsonReader.nextBoolean());
LogUtils.d(TAG, String.format("readBeanFromJsonReader() 读取字段 | %s=%b", name, bean.isCharging())); LogUtils.d(TAG, String.format("readBeanFromJsonReader() 读取字段 | %s=%b", name, bean.isCharging()));
} else if (name.equals("currentValue")) { }
// 优先读取旧字段,兼容历史配置 // else if (name.equals("currentValue")) {
bean.setCurrentBatteryValue(jsonReader.nextInt()); // // 优先读取旧字段,兼容历史配置
LogUtils.d(TAG, "readBeanFromJsonReader() 读取旧字段 | currentValue=" + bean.getCurrentBatteryValue()); // bean.setCurrentBatteryValue(jsonReader.nextInt());
} else if (name.equals("currentBatteryValue")) { // LogUtils.d(TAG, "readBeanFromJsonReader() 读取旧字段 | currentValue=" + bean.getCurrentBatteryValue());
// 新字段覆盖旧字段,保证数据最新 // } else if (name.equals("currentBatteryValue")) {
bean.setCurrentBatteryValue(jsonReader.nextInt()); // // 新字段覆盖旧字段,保证数据最新
LogUtils.d(TAG, "readBeanFromJsonReader() 读取新字段 | currentBatteryValue=" + bean.getCurrentBatteryValue()); // bean.setCurrentBatteryValue(jsonReader.nextInt());
} else if (name.equals("batteryDetectInterval")) { // LogUtils.d(TAG, "readBeanFromJsonReader() 读取新字段 | currentBatteryValue=" + bean.getCurrentBatteryValue());
// }
else if (name.equals("batteryDetectInterval")) {
bean.setBatteryDetectInterval(jsonReader.nextInt()); bean.setBatteryDetectInterval(jsonReader.nextInt());
LogUtils.d(TAG, String.format("readBeanFromJsonReader() 读取字段 | %s=%d", name, bean.getBatteryDetectInterval())); LogUtils.d(TAG, String.format("readBeanFromJsonReader() 读取字段 | %s=%d", name, bean.getBatteryDetectInterval()));
} else if (name.equals("defaultFrameWidth")) { } else if (name.equals("defaultFrameWidth")) {
@@ -299,7 +301,7 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
dest.writeInt(chargeReminderValue); dest.writeInt(chargeReminderValue);
dest.writeInt(reminderIntervalTime); dest.writeInt(reminderIntervalTime);
dest.writeByte((byte) (isCharging ? 1 : 0)); dest.writeByte((byte) (isCharging ? 1 : 0));
dest.writeInt(currentBatteryValue); //dest.writeInt(currentBatteryValue);
dest.writeInt(batteryDetectInterval); dest.writeInt(batteryDetectInterval);
dest.writeInt(defaultFrameWidth); dest.writeInt(defaultFrameWidth);
dest.writeInt(defaultFrameHeight); dest.writeInt(defaultFrameHeight);
@@ -318,7 +320,7 @@ public class AppConfigBean extends BaseBean implements Serializable, Parcelable
bean.chargeReminderValue = source.readInt(); bean.chargeReminderValue = source.readInt();
bean.reminderIntervalTime = source.readInt(); bean.reminderIntervalTime = source.readInt();
bean.isCharging = source.readByte() != 0; bean.isCharging = source.readByte() != 0;
bean.currentBatteryValue = source.readInt(); //bean.currentBatteryValue = source.readInt();
bean.batteryDetectInterval = source.readInt(); bean.batteryDetectInterval = source.readInt();
bean.defaultFrameWidth = source.readInt(); bean.defaultFrameWidth = source.readInt();
bean.defaultFrameHeight = source.readInt(); bean.defaultFrameHeight = source.readInt();

View File

@@ -8,6 +8,7 @@ import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.powerbell.models.AppConfigBean; import cc.winboll.studio.powerbell.models.AppConfigBean;
import cc.winboll.studio.powerbell.models.NotificationMessage; import cc.winboll.studio.powerbell.models.NotificationMessage;
import cc.winboll.studio.powerbell.services.ControlCenterService; import cc.winboll.studio.powerbell.services.ControlCenterService;
import cc.winboll.studio.powerbell.threads.RemindThread;
import cc.winboll.studio.powerbell.utils.AppConfigUtils; import cc.winboll.studio.powerbell.utils.AppConfigUtils;
import cc.winboll.studio.powerbell.utils.BatteryUtils; import cc.winboll.studio.powerbell.utils.BatteryUtils;
import cc.winboll.studio.powerbell.utils.NotificationManagerUtils; import cc.winboll.studio.powerbell.utils.NotificationManagerUtils;
@@ -138,7 +139,7 @@ public class ControlCenterServiceReceiver extends BroadcastReceiver {
latestConfig.getChargeReminderValue(), latestConfig.getUsageReminderValue())); latestConfig.getChargeReminderValue(), latestConfig.getUsageReminderValue()));
// 同步缓存的电池状态到配置 // 同步缓存的电池状态到配置
latestConfig.setCurrentBatteryValue(sLastBatteryLevel); RemindThread.sQuantityOfElectricity = sLastBatteryLevel;
latestConfig.setIsCharging(sIsCharging); latestConfig.setIsCharging(sIsCharging);
service.notifyAppConfigUpdate(latestConfig); service.notifyAppConfigUpdate(latestConfig);

View File

@@ -55,7 +55,7 @@ public class RemindThread extends Thread {
private volatile long sleepTime; private volatile long sleepTime;
private volatile int chargeReminderValue; private volatile int chargeReminderValue;
private volatile int usageReminderValue; private volatile int usageReminderValue;
private volatile int quantityOfElectricity; public static volatile int sQuantityOfElectricity = INVALID_BATTERY_VALUE;;
private volatile boolean isCharging; private volatile boolean isCharging;
// ====================== 私有构造器(禁止外部实例化) ====================== // ====================== 私有构造器(禁止外部实例化) ======================
@@ -117,7 +117,7 @@ public class RemindThread extends Thread {
* @param batteryLevel 当前电量 * @param batteryLevel 当前电量
* @return true: 启动成功false: 入参非法 * @return true: 启动成功false: 入参非法
*/ */
public static boolean startRemindThreadWithBatteryInfo(Context context, ControlCenterServiceHandler handler, boolean isCharging, int batteryLevel) { /*public static boolean startRemindThreadWithBatteryInfo(Context context, ControlCenterServiceHandler handler, boolean isCharging, int batteryLevel) {
LogUtils.d(TAG, String.format("startRemindThreadWithBatteryInfo调用 | context=%s | handler=%s | isCharging=%b | batteryLevel=%d", context, handler, isCharging, batteryLevel)); LogUtils.d(TAG, String.format("startRemindThreadWithBatteryInfo调用 | context=%s | handler=%s | isCharging=%b | batteryLevel=%d", context, handler, isCharging, batteryLevel));
// 入参严格校验 // 入参严格校验
@@ -143,13 +143,13 @@ public class RemindThread extends Thread {
RemindThread newRemindThread = new RemindThread(context, handler); RemindThread newRemindThread = new RemindThread(context, handler);
// 同步电池状态(范围校验) // 同步电池状态(范围校验)
newRemindThread.isCharging = isCharging; newRemindThread.isCharging = isCharging;
newRemindThread.quantityOfElectricity = Math.min(Math.max(batteryLevel, BATTERY_LEVEL_MIN), BATTERY_LEVEL_MAX); newRemindThread.sQuantityOfElectricity = Math.min(Math.max(batteryLevel, BATTERY_LEVEL_MIN), BATTERY_LEVEL_MAX);
newRemindThread.isExist = false; newRemindThread.isExist = false;
newRemindThread.start(); newRemindThread.start();
sRemindThreadList.add(newRemindThread); sRemindThreadList.add(newRemindThread);
LogUtils.d(TAG, String.format("新线程启动成功 | threadId=%d | 电池状态同步完成(电量=%d充电=%b", newRemindThread.getId(), newRemindThread.quantityOfElectricity, newRemindThread.isCharging)); LogUtils.d(TAG, String.format("新线程启动成功 | threadId=%d | 电池状态同步完成(电量=%d充电=%b", newRemindThread.getId(), newRemindThread.sQuantityOfElectricity, newRemindThread.isCharging));
return true; return true;
} }*/
/** /**
* 安全停止所有线程,清空列表 * 安全停止所有线程,清空列表
@@ -213,21 +213,21 @@ public class RemindThread extends Thread {
if (isExist) break; if (isExist) break;
// 电量有效性校验非0-100视为无效退出电量提醒线程 // 电量有效性校验非0-100视为无效退出电量提醒线程
if (quantityOfElectricity < BATTERY_LEVEL_MIN || quantityOfElectricity > BATTERY_LEVEL_MAX) { if (sQuantityOfElectricity < BATTERY_LEVEL_MIN || sQuantityOfElectricity > BATTERY_LEVEL_MAX) {
LogUtils.w(TAG, String.format("电量无效,退出电量提醒线程 | 当前电量=%d | threadId=%d", quantityOfElectricity, getId())); LogUtils.w(TAG, String.format("电量无效,退出电量提醒线程 | 当前电量=%d | threadId=%d", sQuantityOfElectricity, getId()));
break; break;
} }
// 充电/耗电提醒触发逻辑 // 充电/耗电提醒触发逻辑
boolean chargeRemindTrigger = isCharging && isEnableChargeReminder && quantityOfElectricity >= chargeReminderValue; boolean chargeRemindTrigger = isCharging && isEnableChargeReminder && sQuantityOfElectricity >= chargeReminderValue;
boolean usageRemindTrigger = !isCharging && isEnableUsageReminder && quantityOfElectricity <= usageReminderValue; boolean usageRemindTrigger = !isCharging && isEnableUsageReminder && sQuantityOfElectricity <= usageReminderValue;
if (chargeRemindTrigger) { if (chargeRemindTrigger) {
LogUtils.d(TAG, String.format("触发充电提醒 | 当前电量=%d ≥ 阈值=%d | threadId=%d", quantityOfElectricity, chargeReminderValue, getId())); LogUtils.d(TAG, String.format("触发充电提醒 | 当前电量=%d ≥ 阈值=%d | threadId=%d", sQuantityOfElectricity, chargeReminderValue, getId()));
sendNotificationMessageInternal(REMIND_TYPE_CHARGE, quantityOfElectricity, isCharging); sendNotificationMessageInternal(REMIND_TYPE_CHARGE, sQuantityOfElectricity, isCharging);
} else if (usageRemindTrigger) { } else if (usageRemindTrigger) {
LogUtils.d(TAG, String.format("触发耗电提醒 | 当前电量=%d ≤ 阈值=%d | threadId=%d", quantityOfElectricity, usageReminderValue, getId())); LogUtils.d(TAG, String.format("触发耗电提醒 | 当前电量=%d ≤ 阈值=%d | threadId=%d", sQuantityOfElectricity, usageReminderValue, getId()));
sendNotificationMessageInternal(REMIND_TYPE_USAGE, quantityOfElectricity, isCharging); sendNotificationMessageInternal(REMIND_TYPE_USAGE, sQuantityOfElectricity, isCharging);
} else { } else {
LogUtils.d(TAG, String.format("未有合适类型提醒,退出提醒线程 | threadId=%d", getId())); LogUtils.d(TAG, String.format("未有合适类型提醒,退出提醒线程 | threadId=%d", getId()));
break; break;
@@ -237,7 +237,7 @@ public class RemindThread extends Thread {
safeSleepInternal(sleepTime); safeSleepInternal(sleepTime);
} catch (Exception e) { } catch (Exception e) {
LogUtils.e(TAG, String.format("循环运行异常,退出电量提醒线程 | 当前电量=%d | threadId=%d", quantityOfElectricity, getId()), e); LogUtils.e(TAG, String.format("循环运行异常,退出电量提醒线程 | 当前电量=%d | threadId=%d", sQuantityOfElectricity, getId()), e);
break; break;
} }
} }
@@ -315,7 +315,6 @@ public class RemindThread extends Thread {
sleepTime = MIN_SLEEP_TIME; sleepTime = MIN_SLEEP_TIME;
chargeReminderValue = -1; chargeReminderValue = -1;
usageReminderValue = -1; usageReminderValue = -1;
quantityOfElectricity = INVALID_BATTERY_VALUE;
isCharging = false; isCharging = false;
LogUtils.d(TAG, String.format("线程初始状态重置完成 | threadId=%d", getId())); LogUtils.d(TAG, String.format("线程初始状态重置完成 | threadId=%d", getId()));
} }
@@ -327,7 +326,7 @@ public class RemindThread extends Thread {
LogUtils.d(TAG, String.format("cleanThreadStateInternal调用 | threadId=%d", getId())); LogUtils.d(TAG, String.format("cleanThreadStateInternal调用 | threadId=%d", getId()));
isReminding = false; isReminding = false;
isExist = true; isExist = true;
quantityOfElectricity = INVALID_BATTERY_VALUE; sQuantityOfElectricity = INVALID_BATTERY_VALUE;
// 中断当前线程(如果存活) // 中断当前线程(如果存活)
if (isAlive()) { if (isAlive()) {
interrupt(); interrupt();
@@ -344,7 +343,7 @@ public class RemindThread extends Thread {
LogUtils.d(TAG, String.format("setAppConfigBean调用 | config=%s | threadId=%d", config, getId())); LogUtils.d(TAG, String.format("setAppConfigBean调用 | config=%s | threadId=%d", config, getId()));
if (config == null) { if (config == null) {
LogUtils.e(TAG, String.format("配置同步失败配置Bean为空 | threadId=%d", getId())); LogUtils.e(TAG, String.format("配置同步失败配置Bean为空 | threadId=%d", getId()));
quantityOfElectricity = INVALID_BATTERY_VALUE; sQuantityOfElectricity = INVALID_BATTERY_VALUE;
return; return;
} }
@@ -354,12 +353,12 @@ public class RemindThread extends Thread {
chargeReminderValue = Math.min(Math.max(config.getChargeReminderValue(), BATTERY_LEVEL_MIN), BATTERY_LEVEL_MAX); chargeReminderValue = Math.min(Math.max(config.getChargeReminderValue(), BATTERY_LEVEL_MIN), BATTERY_LEVEL_MAX);
usageReminderValue = Math.min(Math.max(config.getUsageReminderValue(), BATTERY_LEVEL_MIN), BATTERY_LEVEL_MAX); usageReminderValue = Math.min(Math.max(config.getUsageReminderValue(), BATTERY_LEVEL_MIN), BATTERY_LEVEL_MAX);
sleepTime = Math.max(config.getBatteryDetectInterval(), MIN_SLEEP_TIME); sleepTime = Math.max(config.getBatteryDetectInterval(), MIN_SLEEP_TIME);
quantityOfElectricity = (config.getCurrentBatteryValue() >= BATTERY_LEVEL_MIN && config.getCurrentBatteryValue() <= BATTERY_LEVEL_MAX) // sQuantityOfElectricity = (config.getCurrentBatteryValue() >= BATTERY_LEVEL_MIN && config.getCurrentBatteryValue() <= BATTERY_LEVEL_MAX)
? config.getCurrentBatteryValue() : INVALID_BATTERY_VALUE; // ? config.getCurrentBatteryValue() : INVALID_BATTERY_VALUE;
isCharging = config.isCharging(); isCharging = config.isCharging();
LogUtils.d(TAG, String.format("配置同步完成 | 休眠时间=%dms | 充电提醒=%b | 耗电提醒=%b | 当前电量=%d | 充电阈值=%d | 耗电阈值=%d | threadId=%d", LogUtils.d(TAG, String.format("配置同步完成 | 休眠时间=%dms | 充电提醒=%b | 耗电提醒=%b | 当前电量=%d | 充电阈值=%d | 耗电阈值=%d | threadId=%d",
sleepTime, isEnableChargeReminder, isEnableUsageReminder, quantityOfElectricity, chargeReminderValue, usageReminderValue, getId())); sleepTime, isEnableChargeReminder, isEnableUsageReminder, sQuantityOfElectricity, chargeReminderValue, usageReminderValue, getId()));
} }
/** /**
@@ -392,7 +391,7 @@ public class RemindThread extends Thread {
", isReminding=" + isReminding + ", isReminding=" + isReminding +
", chargeThreshold=" + chargeReminderValue + ", chargeThreshold=" + chargeReminderValue +
", usageThreshold=" + usageReminderValue + ", usageThreshold=" + usageReminderValue +
", currentBattery=" + quantityOfElectricity + ", currentBattery=" + sQuantityOfElectricity +
", isCharging=" + isCharging + ", isCharging=" + isCharging +
", sleepTime=" + sleepTime + "ms" + ", sleepTime=" + sleepTime + "ms" +
'}'; '}';

View File

@@ -5,6 +5,7 @@ import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.powerbell.App; import cc.winboll.studio.powerbell.App;
import cc.winboll.studio.powerbell.models.AppConfigBean; import cc.winboll.studio.powerbell.models.AppConfigBean;
import cc.winboll.studio.powerbell.models.ControlCenterServiceBean; import cc.winboll.studio.powerbell.models.ControlCenterServiceBean;
import cc.winboll.studio.powerbell.threads.RemindThread;
/** /**
* 应用配置工具类:管理应用核心配置(服务开关、电池提醒阈值、背景设置等) * 应用配置工具类:管理应用核心配置(服务开关、电池提醒阈值、背景设置等)
@@ -248,12 +249,12 @@ public class AppConfigUtils {
LogUtils.d(TAG, String.format("setCurrentBatteryValue调用 | 传入电量=%d", value)); LogUtils.d(TAG, String.format("setCurrentBatteryValue调用 | 传入电量=%d", value));
int calibratedValue = Math.min(Math.max(value, MIN_REMINDER_VALUE), MAX_REMINDER_VALUE); int calibratedValue = Math.min(Math.max(value, MIN_REMINDER_VALUE), MAX_REMINDER_VALUE);
if (calibratedValue == mAppConfigBean.getCurrentBatteryValue()) { if (calibratedValue == RemindThread.sQuantityOfElectricity) {
LogUtils.d(TAG, "setCurrentBatteryValue电池电量无变化无需操作"); LogUtils.d(TAG, "setCurrentBatteryValue电池电量无变化无需操作");
return; return;
} }
mAppConfigBean.setCurrentBatteryValue(calibratedValue); RemindThread.sQuantityOfElectricity = calibratedValue;
LogUtils.d(TAG, String.format("setCurrentBatteryValue成功 | 电池电量=%d%%", calibratedValue)); LogUtils.d(TAG, String.format("setCurrentBatteryValue成功 | 电池电量=%d%%", calibratedValue));
} }
@@ -262,7 +263,7 @@ public class AppConfigUtils {
* @return 当前电池电量0-100 * @return 当前电池电量0-100
*/ */
public int getCurrentBatteryValue() { public int getCurrentBatteryValue() {
int value = mAppConfigBean.getCurrentBatteryValue(); int value = RemindThread.sQuantityOfElectricity;
LogUtils.d(TAG, String.format("getCurrentBatteryValue获取电池电量=%d%%", value)); LogUtils.d(TAG, String.format("getCurrentBatteryValue获取电池电量=%d%%", value));
return value; return value;
} }