title: Android BLE Scan Stops after a couple of minutes in background
body: <p>I faced the Android scan stopping issue in background when I am developing my COVID contact tracing app for my company. Here is what I have tried:</p>
  <ol>
  <li>Add foreground service</li>
  <li>Disable all the battery related optimization options in the phones</li>
  <li>Enable the application running in background</li>
  <li>Tesging devices:Galaxy S20 and Xperia with Android 10, Huawei with Android 8.</li>
  </ol>
  <p>The scan stops immediately when going to background if you don't disable those battery optimization settings and application background update. After you disabled those settings, the scan can run about a couple of minutes(~5 minutes), then still stops. From the blog of David:<a href="http://www.davidgyoungtech.com/2017/08/07/beacon-detection-with-android-8" rel="nofollow noreferrer">http://www.davidgyoungtech.com/2017/08/07/beacon-detection-with-android-8</a>, it seems that it is impossible to scan continuesly in background, because the JobScheduler will restart every 15 minutes while each scan lasts ~10 minutes at most. Is this the reality, or this is the best solution that I can scan 10 minutes at every 15 mins cycle?</p>