question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WorkManager jobs are continuously running in the foreground leading battery drain and increased temps

See original GitHub issue

Home Assistant Android version: 2021.10.0-full (versionCode=761)

Android version: 12

Phone model: Pixel 6 Pro

Home Assistant version:

Description of problem: There seems to be a bug causing WorkManager requests to be scheduled and cancelled very quickly in a short period of time. Particularly requests that are likely using setForegroundAsync causing a foreground service to run consuming more battery and/or causing heat. I do not have specific steps to reproduce, but some of the reviews in the play-store are mentioning heavy background usage which is likely related.

Traceback (if applicable, to get the logs you may refer to: https://companion.home-assistant.io/docs/troubleshooting/faqs/#android-crash-logs):

Please feel free to reach out to me directly to review some private logs.


Screenshot of problem:

Additional information:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vad710commented, Jan 12, 2022

Thanks @dshokouhi , When you have a chance, could you please ping me at first.last@ gee mail dot com ? (name info here: https://github.com/vad710)

Thank you!

1reaction
dshokouhicommented, Dec 22, 2021

Any thoughts of changing the defaults to be a bit more conservative when it comes to power drain? potentially guide the user to select sensors or to turn off invisible sensors by default?

Thats the aim for these 2 PRs actually 😃

#2037 and #2038

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for long-running workers - Android Developers
WorkManager has built-in support for long running workers. In such cases, WorkManager can provide a signal to the OS that the process should...
Read more >
WorkManager: Beyond the basics (Android Dev Summit '19)
Learn more about WorkManager, the Jetpack library for background processing. This talk introduces intermediate and advanced concepts to ...
Read more >
WorkManager for Immediate Tasks - Medium
This blog post focus on how to implement long-running background tasks that ... their job, which leads to drain the battery in a...
Read more >
The Ultimate Guide to Android Bluetooth Low Energy
A BLE device can typically run on a small battery for weeks, ... Check out our Android architecture post for more information on...
Read more >
Android 13 changelog: A deep dive by Mishaal Rahman
It promises lower power consumption and higher audio quality using the new Low ... that is intended to allow “complications” to run on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found