File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
OneSignalSDK/onesignal/src/main/java/com/onesignal Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -333,17 +333,26 @@ public boolean onStopJob(JobParameters params) {
333
333
public JobIntentService .GenericWorkItem dequeueWork () {
334
334
JobWorkItem work ;
335
335
synchronized (mLock ) {
336
- if (mParams == null ) {
336
+ if (mParams == null )
337
+ return null ;
338
+
339
+ try {
340
+ work = mParams .dequeueWork ();
341
+ } catch (SecurityException e ) {
342
+ // Work around for https://issuetracker.google.com/issues/63622293
343
+ // https://github.com/OneSignal/OneSignal-Android-SDK/issues/673
344
+ // Caller no longer running, last stopped +###ms because: last work dequeued
345
+ Log .e (TAG , "Failed to run mParams.dequeueWork()!" , e );
337
346
return null ;
338
347
}
339
- work = mParams .dequeueWork ();
340
348
}
349
+
341
350
if (work != null ) {
342
351
work .getIntent ().setExtrasClassLoader (mService .getClassLoader ());
343
352
return new WrapperWorkItem (work );
344
- } else {
345
- return null ;
346
353
}
354
+ else
355
+ return null ;
347
356
}
348
357
}
349
358
@@ -489,6 +498,7 @@ public IBinder onBind(@NonNull Intent intent) {
489
498
@ Override
490
499
public void onDestroy () {
491
500
super .onDestroy ();
501
+ doStopCurrentWork ();
492
502
synchronized (mCompatQueue ) {
493
503
mDestroyed = true ;
494
504
mCompatWorkEnqueuer .serviceProcessingFinished ();
You can’t perform that action at this time.
0 commit comments