android/system/core/healthd/BatteryMonitor.cpp
.. .. @@ -210,9 +210,14 @@ 210 210 else 211 211 props.batteryPresent = mBatteryDevicePresent; 212 212 213 + if (!props.batteryPresent) {214 + props.batteryLevel = 100;}215 + else {213 216 props.batteryLevel = mBatteryFixedCapacity ? 214 217 mBatteryFixedCapacity : 215 218 getIntField(mHealthdConfig->batteryCapacityPath); 219 + }220 +216 221 props.batteryVoltage = getIntField(mHealthdConfig->batteryVoltagePath) / 1000; 217 222 218 223 if (!mHealthdConfig->batteryCurrentNowPath.isEmpty())