Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86284?usp=email )
Change subject: lib: Add low battery UX locale message ......................................................................
lib: Add low battery UX locale message
This commit adds a new UX locale message to display a warning when the battery is critically low.
The message informs the user about the low battery and indicates that the system is shutting down.
This change ensures that users are notified before the system unexpectedly shuts down due to low battery.
BUG=b:339673254 TEST=Built and booted google/brox.
Change-Id: I75c7a0d4d439901098c7f17a1dc90355307116ac Signed-off-by: Subrata Banik subratabanik@google.com --- M src/include/ux_locales.h M src/lib/ux_locales.c 2 files changed, 5 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/84/86284/1
diff --git a/src/include/ux_locales.h b/src/include/ux_locales.h index 3fea90c..db8861f 100644 --- a/src/include/ux_locales.h +++ b/src/include/ux_locales.h @@ -7,6 +7,7 @@
enum ux_locale_msg { UX_LOCALE_MSG_MEMORY_TRAINING, + UX_LOCALE_MSG_LOW_BATTERY, };
/* Unmap the preram_locales if it has been mapped. No-op otherwise. */ diff --git a/src/lib/ux_locales.c b/src/lib/ux_locales.c index 323a4a9..eb37d3c 100644 --- a/src/lib/ux_locales.c +++ b/src/lib/ux_locales.c @@ -26,6 +26,9 @@ "This may take 1-2 minutes.\n" \ "Please do not turn off your device."
+#define UX_LOW_BATTERY_DESC "low_battery_desc" +#define UX_LOW_BATTERY_MSG "Battery critically low. Shutting down." + /* Mapping of different default UX local message based on message ID */ static const struct { enum ux_locale_msg locale_msg_id; @@ -33,6 +36,7 @@ const char *ux_locale_text_msg; } ux_locale_msg_list[] = { { UX_LOCALE_MSG_MEMORY_TRAINING, UX_MEMORY_TRAINING_DESC, UX_MEMORY_TRAINING_MSG }, + { UX_LOCALE_MSG_LOW_BATTERY, UX_LOW_BATTERY_DESC, UX_LOW_BATTERY_MSG }, };
#define UX_LOCAL_MSG_ELEMENT_COUNT sizeof(ux_locale_msg_list)/sizeof(ux_locale_msg_list[0])