title: android O kills service; what condition resulted into this?
body: <p>I am working on making an app compatible with android-o &amp; I noticed that the system is doing something new with a one of my services in this android version.</p>
  
  <p>The situation:</p>
  
  <ul>
  <li><code>class MyService extends Service { .. }</code> is started together with an activity</li>
  <li><code>MyService.onStartCommand(..)</code> returns <code>START_NOT_STICKY</code></li>
  <li>after user leaves all screens an alarm is is scheduled to be executed a minute later</li>
  </ul>
  
  <p>The new logic I'm experiencing is that <code>MyService</code> gets constantly stopped when the minute-later-alarm starts ringing. Service is consistently stopped immediately before <code>BroadcastReceiver.onReceive(..)</code> is called by the ringing alarm. Also it doesn't seem to matter whether the alarm is set to ring after 60 or 70 secs.</p>
  
  <p>Android O is the only OS version (of the ones i tried) that is doing this. What is the logic here? Can i stop this without returning <code>START_STICKY</code>?</p>