溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

RK3288 手動設置電池電量

發布時間:2020-08-07 15:55:44 來源:ITPUB博客 閱讀:188 作者:tt7643066 欄目:建站服務器

系統版本: 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:

RK3288 手動設置電池電量

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女