title: App in background killed after 5 minutes in Android 9
body: <p>I have recently added to my app a feature enabling sharing screen over the network. This feature becomes especially meaningful when I want to stream the mobile screen outside my app, i.e. putting my app in background.
  While I have no problem on a Samsung S7 with Android 8, the app is constantly killed on a Samsung Active Pro after being 5 minutes in background. However, <em>if the tablet is connected to the usb cable (either to a charger or to my PC) the app remains alive</em>.</p>
  <p>I have disabled battery optimizations for my app and tried other possible user-side actions found on the web without success.</p>
  <p>Is there anything I can do developer-side?
  I've tried to use wakelocks, but that didn't help. In other threads I have read that sending notifications with a foreground service might help: is this a viable solution?</p>