fix: crash around com.onesignal.SyncJobService #2515
Merged
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.
Description
One Line Summary
Add temporary stub implementation of com.onesignal.SyncJobService to prevent background crashes caused by upgrading OneSignal from v4 to v5.
Details
Motivation
Apps upgrading from OneSignal SDK v4 to v5 may encounter a crash when the system attempts to start the legacy com.onesignal.SyncJobService, which no longer exists in the v5 SDK. Devices with previously scheduled v4 JobScheduler jobs will still try to invoke this class, resulting in a ClassNotFoundException and app process crash in the background.
This PR introduces a no-op stub implementation of com.onesignal.SyncJobService so that any remaining v4-scheduled jobs can gracefully run once, complete, and be cleared without crashing the app.
This can be considered a temporary workaround.
Scope
Adds com.onesignal.SyncJobService as a minimal JobService that immediately finishes.
Testing
Unit testing
No testing needed as this is a dummy class.
Manual testing
I am unable to reproduce from the migration path. This is from crashlytics and there must be some conditions for this to happen. Example app is manually ran on an Android emulator Pixel 9 API 35 to ensure normal app usage and no functionality change.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is