diff --git a/headers/private/device/power_managment.h b/headers/private/device/power_managment.h index 945a9af422..aa3126a95e 100644 --- a/headers/private/device/power_managment.h +++ b/headers/private/device/power_managment.h @@ -30,6 +30,7 @@ const uint32 kMagicACPIBatteryID = 17822; #define BATTERY_DISCHARGING 0x01 #define BATTERY_CHARGING 0x02 #define BATTERY_CRITICAL_STATE 0x04 +#define BATTERY_NOT_CHARGING 0x08 #define BATTERY_MAX_STRING_LENGTH 32 diff --git a/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp b/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp index 8bbffa6a89..fe5d9c874a 100644 --- a/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp +++ b/src/add-ons/kernel/drivers/power/acpi_battery/acpi_battery.cpp @@ -106,6 +106,8 @@ ReadBatteryStatus(battery_driver_cookie* cookie, if (batteryStatus->state == UINT32_MAX) batteryStatus->state = BATTERY_CRITICAL_STATE; batteryStatus->current_rate = GetUint32(pointer++); + if (batteryStatus->state == BATTERY_DISCHARGING && batteryStatus->current_rate == 0) + batteryStatus->state = BATTERY_NOT_CHARGING; batteryStatus->capacity = GetUint32(pointer++); batteryStatus->voltage = GetUint32(pointer++); diff --git a/src/apps/powerstatus/ExtendedInfoWindow.cpp b/src/apps/powerstatus/ExtendedInfoWindow.cpp index 104943d44d..f05198b8f2 100644 --- a/src/apps/powerstatus/ExtendedInfoWindow.cpp +++ b/src/apps/powerstatus/ExtendedInfoWindow.cpp @@ -102,6 +102,8 @@ BatteryInfoView::_GetTextForLine(size_t line) string = B_TRANSLATE("Battery charging"); else if ((fBatteryInfo.state & BATTERY_DISCHARGING) != 0) string = B_TRANSLATE("Battery discharging"); + else if ((fBatteryInfo.state & BATTERY_NOT_CHARGING) != 0) + string = B_TRANSLATE("Battery not charging"); else if ((fBatteryInfo.state & BATTERY_CRITICAL_STATE) != 0 && fBatteryExtendedInfo.model_number[0] == '\0' && fBatteryExtendedInfo.serial_number[0] == '\0' diff --git a/src/apps/powerstatus/PowerStatusView.cpp b/src/apps/powerstatus/PowerStatusView.cpp index 1ae89fee73..0abeeae2a3 100644 --- a/src/apps/powerstatus/PowerStatusView.cpp +++ b/src/apps/powerstatus/PowerStatusView.cpp @@ -466,6 +466,8 @@ PowerStatusView::Update(bool force, bool notify) state = B_TRANSLATE("charging"); else if ((fBatteryInfo.state & BATTERY_DISCHARGING) != 0) state = B_TRANSLATE("discharging"); + else if ((fBatteryInfo.state & BATTERY_NOT_CHARGING) != 0) + state = B_TRANSLATE("not charging"); if (state != NULL) { snprintf(text + length, sizeof(text) - length, "\n%s",