title: IllegalThreadStateException OneSignal crash workaround
body: <p>Our app daily receives around 1k crashes based on bug mentioned on <strong>OneSignal's</strong> <a href="https://github.com/OneSignal/OneSignal-Android-SDK/issues/917" rel="noreferrer">github issues</a>.</p>
  
  <hr>
  
  <p><strong>Bug explanation:</strong></p>
  
  <p>Unfortunately, I can't reproduce this issue. All crashes come from
  Crashlytics reports. SDK version 3.12.4</p>
  
  <p><strong>Devices:</strong></p>
  
  <pre><code>1) Samsung: Galaxy A5(2017), Galaxy S8, Galaxy A50, Galaxy S10+, Galaxy S10  
  2) Xiaomi: Mi A2, Mi A2 lite, Mi A1, Mi A3, Redmi Note 5 Pro 
  3) Oneplus: ONEPLUS A6010, OnePlus5T, GM191011, GM19008, OnePlus58
  </code></pre>
  
  <p><strong>Stacktrace:</strong></p>
  
  <pre><code>Caused by java.lang.IllegalThreadStateException
         at java.lang.Thread.start(Thread.java:724)
         at com.onesignal.OneSignalPrefs$WritePrefHandlerThread.startDelayedWrite(OneSignalPrefs.java:117)
         at com.onesignal.OneSignalPrefs.startDelayedWrite(OneSignalPrefs.java:183)
         at com.onesignal.OneSignal.setAppContext(OneSignal.java:601)
         at com.onesignal.OneSignalSyncServiceUtils.doBackgroundSync(OneSignalSyncServiceUtils.java:175)
         at com.onesignal.SyncJobService.onStartJob(SyncJobService.java:40)
         at android.app.job.JobService$1.onStartJob(JobService.java:62)
         at android.app.job.JobServiceEngine$JobHandler.handleMessage(JobServiceEngine.java:108)
         at android.os.Handler.dispatchMessage(Handler.java:106)
         at android.os.Looper.loop(Looper.java:280)
         at android.app.ActivityThread.main(ActivityThread.java:6748)
         at java.lang.reflect.Method.invoke(Method.java)
         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  </code></pre>
  
  <hr>
  
  <p><strong>Question:</strong></p>
  
  <p>The main problem is that they tagged it as medium priority and bug exists around 3 months. Our vitals are going for a toss, just because of this issue. It's costing us a lot. </p>
  
  <p>Does there exist any workaround that can temporary solve the problem?</p>
  
  <hr>
  
  <p><strong>P.S:</strong></p>
  
  <p>I'm ready to provide more related info, if required. Thanks in advance!</p>