Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defer the registration of thermal and power save mode listners to background thread #548

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

bidetofevil
Copy link
Collaborator

@bidetofevil bidetofevil commented Mar 12, 2024

Goal

The services require making a system call to initialize the PowerManager, which can be expensive and take an unpredictable amount of time. Doing that on the main thread on startup isn't ideal, defer the init to a background thread.

Testing

Covered by existing tests

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bidetofevil and the rest of your teammates on Graphite Graphite

@bidetofevil bidetofevil marked this pull request as ready for review March 12, 2024 06:59
@bidetofevil bidetofevil requested a review from a team as a code owner March 12, 2024 06:59
Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Attention: Patch coverage is 82.14286% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 79.74%. Comparing base (c1735c9) to head (2acccbf).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #548      +/-   ##
==========================================
+ Coverage   79.70%   79.74%   +0.03%     
==========================================
  Files         409      409              
  Lines       10927    10938      +11     
  Branches     1613     1614       +1     
==========================================
+ Hits         8709     8722      +13     
+ Misses       1571     1569       -2     
  Partials      647      647              
Files Coverage Δ
...d/embracesdk/injection/DataCaptureServiceModule.kt 100.00% <100.00%> (+1.61%) ⬆️
...k/capture/powersave/EmbracePowerSaveModeService.kt 87.23% <90.00%> (+0.87%) ⬆️
...apture/thermalstate/EmbraceThermalStatusService.kt 72.41% <66.66%> (-0.32%) ⬇️

... and 1 file with indirect coverage changes

@bidetofevil bidetofevil merged commit fb350b3 into master Mar 12, 2024
5 checks passed
@bidetofevil bidetofevil deleted the hho/defer-power-and-thermal-service-reg branch March 12, 2024 07:15
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.

None yet

2 participants