RK3288 manually sets the battery charge
System version: RK3288 android 5.1 (slightly different from referenced variables and macros)
The device does not have a battery. During the Fota upgrade, it is suggested that the battery should not be less than 30%, with an external power supply, but the read power is 0%, so you can only manually set the battery charge.
$adb shell dumpsys battery / / query battery information through adb
Current Battery Service state:
AC powered: false
USB powered: false
Wireless powered: false
Status: 1
Health: 1
Present: true
Level: 0 / / Battery charge
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")
+ / *-the battery charge always shows 100% Mustang /
+ mBatteryFixedCapacity = FAKE_BATTERY_CAPACITY; / / Power level
+ mBatteryFixedTemperature = FAKE_BATTERY_TEMPERATURE; / / 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 / / Battery charge
Scale: 100
Voltage: 0
Temperature: 424
Technology: