Skip to content

RUM-13567: Avoid querying battery during initialization#3099

Merged
jonathanmos merged 1 commit into
developfrom
jmoskovich/rum-13567/fix-battery-anr
Jan 7, 2026
Merged

RUM-13567: Avoid querying battery during initialization#3099
jonathanmos merged 1 commit into
developfrom
jmoskovich/rum-13567/fix-battery-anr

Conversation

@jonathanmos

Copy link
Copy Markdown
Member

What does this PR do?

Instead of populating the initial battery level when the battery provider starts up, here we instead rely on lazy querying whenever getState is called.

Motivation

Move battery level querying entirely off the main thread.

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-official

datadog-official Bot commented Jan 5, 2026

Copy link
Copy Markdown

🎯 Code Coverage
Patch Coverage: 100.00%
Overall Coverage: 66.49% (+0.01%)

View detailed report

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: efb3204 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-13567/fix-battery-anr branch 2 times, most recently from 438d110 to c1c9312 Compare January 6, 2026 08:18
@codecov-commenter

codecov-commenter commented Jan 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.40%. Comparing base (70ecc68) to head (efb3204).
⚠️ Report is 48 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3099      +/-   ##
===========================================
- Coverage    71.46%   71.40%   -0.07%     
===========================================
  Files          880      880              
  Lines        32480    32479       -1     
  Branches      5473     5474       +1     
===========================================
- Hits         23211    23189      -22     
- Misses        7728     7739      +11     
- Partials      1541     1551      +10     
Files with missing lines Coverage Δ
...ernal/domain/battery/DefaultBatteryInfoProvider.kt 82.93% <100.00%> (-0.41%) ⬇️

... and 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jonathanmos
jonathanmos force-pushed the jmoskovich/rum-13567/fix-battery-anr branch from c1c9312 to f8fb549 Compare January 6, 2026 10:41
@jonathanmos
jonathanmos marked this pull request as ready for review January 7, 2026 08:45
@jonathanmos
jonathanmos requested a review from a team as a code owner January 7, 2026 08:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8fb549ca7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ambushwork
ambushwork previously approved these changes Jan 7, 2026
@jonathanmos
jonathanmos merged commit cb4aa45 into develop Jan 7, 2026
26 checks passed
@jonathanmos
jonathanmos deleted the jmoskovich/rum-13567/fix-battery-anr branch January 7, 2026 12:18
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.

4 participants