您好,登錄后才能下訂單哦!
系統(tǒng)版本: RK3288 android 5.1 (與參考的變量和宏有點區(qū)別)
設(shè)備沒有電池,在進行 Fota 升級時,提示電量不能低于 30% ,外接電源,可是讀出來的電量是 0% ,無法進行升級,只能手動設(shè)置電池電量。
$ 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:
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。