feat(core/firmware): add battery SoC to Features
What changed, and why it matters
This commit adds a new piece of information—battery charge percentage (SoC, State of Charge)—to the device's public 'Features' response. It only reads a value from the power manager and exposes it. There is no security-sensitive change: no new permissions, no bypass of protections, no handling of secrets, and no memory-safety issue visible in the diff.
No security action required. Treat as a normal feature addition during routine review.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch extends get_features() in core/src/apps/base.py to conditionally include f.soc when utils.USE_POWER_MANAGER is enabled. It imports trezorio.pm and calls pm.soc(). This is a read-only addition to the Features protobuf message and does not alter authentication, storage, crypto, or access-control logic.
Changed components
core/src/apps/base.pyFeatures message / device info responseInspect captured patch +5 / −0
diff --git a/core/src/apps/base.py b/core/src/apps/base.py
index 7d3d680a1..d8afaff81 100644
--- a/core/src/apps/base.py
+++ b/core/src/apps/base.py
@@ -179,6 +179,11 @@ def get_features() -> Features:
f.initialized = storage_device.is_initialized()
+ if utils.USE_POWER_MANAGER:
+ from trezorio import pm
+
+ f.soc = pm.soc()
+
# private fields:
if config.is_unlocked():
# passphrase_protection is private, see #1807
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.