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

[Perf Improvement] Respect device battery and other constaints by moving deferrable tasks to Work Manager #57

Open
aakash1313 opened this issue Apr 25, 2020 · 2 comments

Comments

@aakash1313
Copy link
Collaborator

No description provided.

@aakash1313 aakash1313 changed the title Move deferrable tasks to Work Manager instead of Intent Service [Perf Improvement] Respect device battery and other constaints by moving deferrable tasks to Work Manager instead of Intent Service Apr 25, 2020
@aakash1313 aakash1313 changed the title [Perf Improvement] Respect device battery and other constaints by moving deferrable tasks to Work Manager instead of Intent Service [Perf Improvement] Respect device battery and other constaints by moving deferrable tasks to Work Manager Apr 26, 2020
@justinklchan
Copy link
Contributor

justinklchan commented Apr 26, 2020

@aakash1313 Runnables to consider moving to WorkManager:
UUIDGeneratorTask - Generates a new seed/uuid pair. This can involve generating several pairs via generateSeedHelper() if the user turned off their phone for some time between the last time the seed/uuid was generated. To use the new uuid, it turns off and turns on the Bluetooth transmitter.

BluetoothScanHelper - the logic around this is that it scans for Bluetooth IDs every 5 minutes for 10 seconds. So that part of the logic should still work after this refactor.

RegenerateSeedUponReport is a potentially longer running AsyncTask, might be good to defer this.
To provide some context for this, when the user submits an infection report. We delete all their previous seeds and UUIDs, and we regenerate 2 full weeks of seeds and UUIDs again (it's not that many only ~1300), but still we'd probably want to not make this an AsyncTask since it's doing a bunch of database inserts for each of the seeds/uuids it's generating.

I wonder if doing this will help to resolve #53

@aakash1313
Copy link
Collaborator Author

@justinklchan : I think these all need to be done in less than 15 mins or urgently, it would be better move UUIDGeneratorTask, BluetoothScanHelper and RegenerateSeedUponReport to Tasks. Let me know what you think?

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

No branches or pull requests

2 participants