charger: minui error handling fixups
Log an error if minui init fails, and avoid subsequent calls to minui
in this case (which are likely to crash).
Warn if no system text font available. This is now expected on most
devices, and the fallback text is not expected to be needed, but just
in case.
Avoid the attempt to print text if no system font available, log
warnings instead.
Bug: 80249440
Test: manual: charger mode with no system font
Change-Id: Ib0c761d37e41a893b2a192438eebcf48c4827049
diff --git a/healthd/healthd_draw.h b/healthd/healthd_draw.h
index 6a6ba76..7c847bd 100644
--- a/healthd/healthd_draw.h
+++ b/healthd/healthd_draw.h
@@ -70,6 +70,12 @@
const bool kSplitScreen;
// Pixels to offset graphics towards center split.
const int kSplitOffset;
+
+ // system text font, may be nullptr
+ const GRFont* sys_font;
+
+ // true if minui init'ed OK, false if minui init failed
+ bool graphics_available;
};
#endif // HEALTHD_DRAW_H