Repository navigation
Record the charge counter and the current in the battery log - #7
Merged
Merged
Conversation
The battery method reads both; they come from the battery service's own lines, never from the event history dumpsys prints after them. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes and why:
scripts/battery-log.mjsalso records the charge counter (µAh) and the current (mA) every 10 s, as the battery method indocs/method.mdproposes. A phone that does not print a field logsnone.dumpsys batteryprints after them is never read, since it holds times of use and other apps.docs/method.md,docs/protocol-details.mdand the CHANGELOG say what the logger records.Tests run (see CONTRIBUTING.md):
node --test tests/node.test.mjs tests/charts.test.mjs: all pass. A new test puts history-shaped lines before and after the service block and checks that nothing from them reaches the log. Mutants that readcc:from the history, take the last match, or drop the anchors make it fail.For a result under
community-results/: commit built, device, browser:Not applicable.
AI disclosure: no AI assistance / AI-assisted (tool and what it did):
AI-assisted: Claude Code wrote the change and the tests; a separate AI review pass audited them.
🤖 Generated with Claude Code