Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Version used:1.0.0-alpha06
Devices/Android versions reproduced on:Redmi 3 (5.1.1), TURKCELL T60 (5.0.2), SM-N9005 (5.0), SM-G850M (5.0.2)
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue. N/A. This is reported by google developer console and we cannot repro it.
- A screenrecord or screenshots showing the issue (if UI related). N/A
Our app uses WorkManager in 2 processes, which are main process and crash handling process. We extends Application class and initialize WorkManager in Application.onCreate of both processes:
androidx.work.Configuration configuration = new androidx.work.Configuration.Builder().build();
WorkManager.initialize(this, configuration);
Then we set thread default uncaught exception handler in main process, so that when an uncaught exception happens, we start a service which runs a crash handling process. In the service send the exception details to our backend service, with the following codes:
WorkManager.getInstance().cancelAllWork();
Constraints.Builder builder = new Constraints.Builder();
builder.setRequiresCharging(true)
.setRequiredNetworkType(NetworkType.UNMETERED);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
builder.setRequiresDeviceIdle(true);
}
Constraints constraints = builder.build();
OneTimeWorkRequest work =
new OneTimeWorkRequest.Builder(ErrorReportWorker.class)
.setConstraints(constraints)
.build();
WorkManager.getInstance().enqueue(work);
In ErrorReportWorker we simply do HTTP post to our backend REST API to send the crash info. We have tested this works without any problem until we see several exceptions like this in our backend service. Please let me know if you need more info. I can certainly create a sample project but it will not repro this issue.