lin
2025-07-30 fcd736bf35fd93b563e9bbf594f2aa7b62028cc9
android/system/core/healthd/BatteryMonitor.cpp
....@@ -210,9 +210,14 @@
210210 else
211211 props.batteryPresent = mBatteryDevicePresent;
212212
213
+ if (!props.batteryPresent) {
214
+ props.batteryLevel = 100;}
215
+ else {
213216 props.batteryLevel = mBatteryFixedCapacity ?
214217 mBatteryFixedCapacity :
215218 getIntField(mHealthdConfig->batteryCapacityPath);
219
+ }
220
+
216221 props.batteryVoltage = getIntField(mHealthdConfig->batteryVoltagePath) / 1000;
217222
218223 if (!mHealthdConfig->batteryCurrentNowPath.isEmpty())