完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
系统版本:RK3288 android 5.1 (与参考的变量和宏有点区别)
设备没有电池,在进行Fota升级时,提示电量不能低于30%,外接电源,可是读出来的电量是0%,无法进行升级,只能手动设置电池电量。 $ adb shell dumpsys battery //通过adb查询电池信息 Current Battery Service state: AC powered: false USB powered: false Wireless powered: false status: 1 health: 1 present: true level: 0 //电池电量 scale: 100 voltage: 0 temperature: 0 technology: diff --git a/system/core/healthd/BatteryMonitor.cpp b/system/core/healthd/BatteryMonitor.cpp old mode 100644 new mode 100755 index d317b28..6b37dee --- a/system/core/healthd/BatteryMonitor.cpp +++ b/system/core/healthd/BatteryMonitor.cpp @@ -35,7 +35,7 @@ #define POWER_SUPPLY_SUBSYSTEM "power_supply" #define POWER_SUPPLY_SYSFS_PATH "/sys/class/" POWER_SUPPLY_SUBSYSTEM -#define FAKE_BATTERY_CAPACITY 42 +#define FAKE_BATTERY_CAPACITY 100 #define FAKE_BATTERY_TEMPERATURE 424 namespace android { @@ -513,8 +513,14 @@ void BatteryMonitor::init(struct healthd_config *hc) { closedir(dir); } - if (!mChargerNames.size()) + if (!mChargerNames.size()) { KLOG_ERROR(LOG_TAG, "No charger supplies foundn"); + /*------------电池电量一直显示100%------------*/ + mBatteryFixedCapacity = FAKE_BATTERY_CAPACITY; //电量 level + mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE; //温度 temperature + mBatteryDevicePresent = true; + /*------------------------------------------------*/ + } if (!mBatteryDevicePresent) { KLOG_WARNING(LOG_TAG, "No battery devices foundn"); hc->periodic_chores_interval_fast = -1; $ adb shell dumpsys battery Current Battery Service state: AC powered: false USB powered: false Wireless powered: false status: 1 health: 1 present: true level: 100 //电池电量 scale: 100 voltage: 0 temperature: 424 technology: |
|
|
|
|
|
基于米尔瑞芯微RK3576核心板/开发板的人脸疲劳检测应用方案
678 浏览 0 评论
920 浏览 1 评论
814 浏览 1 评论
2030 浏览 1 评论
3275 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 00:33 , Processed in 0.621994 second(s), Total 69, Slave 50 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号