Skip to content

Commit

Permalink
[health] fix charging flag
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Jan 21, 2025
1 parent 1eec1f9 commit ea177cd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class BatteryMonitor(

val status: Int = batteryStatus?.getIntExtra(BatteryManager.EXTRA_STATUS, -1) ?: -1
val isCharging: Boolean = status == BatteryManager.BATTERY_STATUS_CHARGING
|| status == BatteryManager.BATTERY_STATUS_FULL

// How are we charging?
val chargePlug: Int = batteryStatus?.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1) ?: -1
Expand Down Expand Up @@ -51,8 +50,10 @@ class BatteryMonitor(
when {
acCharge -> 2L
usbCharge -> 4L
isCharging -> 1L
else -> 0L
} + when (isCharging) {
true -> 1L
false -> 0L
},
"flags",
"Is the phone charging?"
Expand Down

0 comments on commit ea177cd

Please sign in to comment.