Don't show estimated charging time if it is zero
This commit is contained in:
parent
82dd0a93c2
commit
29a06dfc4f
@ -150,7 +150,7 @@ class BatteryPartProvider : PartProvider {
|
||||
level = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY),
|
||||
charging = batteryManager.isCharging,
|
||||
fullIn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
batteryManager.computeChargeTimeRemaining().takeIf { it >= 0 }
|
||||
batteryManager.computeChargeTimeRemaining().takeIf { it > 0 }
|
||||
} else null,
|
||||
)
|
||||
)
|
||||
@ -165,7 +165,7 @@ class BatteryPartProvider : PartProvider {
|
||||
BatteryManager.BATTERY_STATUS_UNKNOWN
|
||||
) == BatteryManager.BATTERY_STATUS_CHARGING,
|
||||
fullIn = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
batteryManager.computeChargeTimeRemaining().takeIf { it >= 0 }
|
||||
batteryManager.computeChargeTimeRemaining().takeIf { it > 0 }
|
||||
} else null,
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user