Skip to content

battery: guard _exists = true assignment inside if condition#5009

Open
EvansJahja wants to merge 1 commit intoAlexays:masterfrom
EvansJahja:charon77/battery_fix
Open

battery: guard _exists = true assignment inside if condition#5009
EvansJahja wants to merge 1 commit intoAlexays:masterfrom
EvansJahja:charon77/battery_fix

Conversation

@EvansJahja
Copy link
Copy Markdown

A lot of parsing functionalities in battery is unguarded. On my device, this causes a lot of misreported battery events (being reported as 0%) because read may fail / not returning numbers for various reasons.

Wrapping them in conditional before setting _exists = true solves the problem on my device.

Related: #5007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant