title: Foreground service is killed in Android 10
body: <p>In Android 10, some manufacturer comes with the new feature in a battery optimization setting (see the picture). My foreground service getting killed by OS after some time when the screen is off.</p>
  
  <p>I have used the foreground service with notification. This code is working well when the screen is ON in all devices. I am facing this issue in OnePlus and realMe device, both having an android 10 OS.</p>
  
  <p>I want to know,
  Is there any way to solve this problem?
  Is there any way to know in my device is having such kind of setting?</p>
  
  <p>Thanks for help!</p>
  
  <p><a href="https://i.stack.imgur.com/YyKmg.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/YyKmg.jpg" alt="OnePlus7"></a></p>