Repository navigation
Conversation
The guard inside the worker and WorkManager's charging constraint read different signals. In the "plugged in but not charging" state WorkManager reports the constraint as unmet while the battery still reports BATTERY_STATUS_CHARGING, so the guard did not fire: JobScheduler started the work, WorkManager stopped it again and rescheduled, and both kept doing that thousands of times per night. Ask BatteryManager.isCharging(), the value WorkManager's BatteryChargingTracker evaluates, so the worker and the constraint agree. Assisted-by: OpenCode:DeepSeek V4.1 Flash Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
The external files collection changes on downloads, documents and other files that auto upload never reads. Watching it made unrelated file changes start the whole auto-upload pipeline. Observe the image and video collections only. Assisted-by: OpenCode:DeepSeek V4.1 Flash Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
Auto upload marks a conflicted file as handled, but the next scan saw a failed upload row, deleted it and queued the file again. With the ASK_USER collision policy nothing resolved the conflict, so the same files were uploaded again on every scan. Keep the file handled when the last result cannot succeed by retrying. Resolving the conflict in the upload list still starts a new upload through FileUploadWorker. Assisted-by: OpenCode:DeepSeek V4.1 Flash Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
4 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixes the background-work part of #18148; independent of #18156.
BatteryStatus.isCharging(EXTRA_STATUS) while the constraint usesBatteryManager.isCharging(). In the "plugged in but not charging" state (Protect battery at 80 %) they disagree, and the two reschedule each other ~60k times a night. Restores the check removed in 007de71 (fix(auto-upload): stop worker restart loop at battery charge limit #18049).MediaStore.Filesalso fires for downloads and documents and started the whole pipeline; keep images and videos.Testing: the three affected test classes and
spotlessKotlinCheckpass;detekt/spotbugsadd no findings.🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)