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

Clear invalid JobScheduler data on boot #117

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Conversation

chenxiaolong
Copy link
Owner

For unknown reasons, there have been two instances in the wild where Android, at some point, reassigned Custota's app UID. Perhaps something caused Custota's APK to disappear temporarily for one boot?

When this happens, the JobScheduler XML file for the old UID gets left behind. While the old job does not show up in dumpsys jobscheduler, it still continues to run. This can cause crashes when UpdaterJob is launched with invalid old parameters.

This commit works around the problem by deleting JobScheduler XML files with a matching package name, but invalid UID, during boot.

Fixes: #116

@chenxiaolong chenxiaolong self-assigned this Jan 18, 2025
For unknown reasons, there have been two instances in the wild where
Android, at some point, reassigned Custota's app UID. Perhaps something
caused Custota's APK to disappear temporarily for one boot?

When this happens, the JobScheduler XML file for the old UID gets left
behind. While the old job does not show up in `dumpsys jobscheduler`,
it still continues to run. This can cause crashes when UpdaterJob is
launched with invalid old parameters.

This commit works around the problem by deleting JobScheduler XML files
with a matching package name, but invalid UID, during boot.

Fixes: #116

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong merged commit 97531d0 into master Jan 18, 2025
6 checks passed
chenxiaolong added a commit that referenced this pull request Jan 18, 2025
Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
@chenxiaolong chenxiaolong deleted the job-scheduler-xml branch January 18, 2025 02:21
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.

Crash on boot? - Out of bounds exception
1 participant