您好,登錄后才能下訂單哦!
系統版本: 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 found\n" );
+ /*------------ 電池電量一直顯示 100%------------*/
+ mBatteryFixedCapacity = FAKE_BATTERY_CAPACITY; // 電量 level
+ mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE; // 溫度 temperature
+ mBatteryDevicePresent = true ;
+ /*------------------------------------------------*/
+ }
if (!mBatteryDevicePresent) {
KLOG_WARNING(LOG_TAG, "No battery devices found\n" );
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:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。