startAsForegroundService property

bool startAsForegroundService
final

Sets whether the DFU service should be started as a foreground service. By default it's true. According to https://developer.android.com/about/versions/oreo/background.html the background service may be killed by the system on Android Oreo after user quits the application so it is recommended to keep it as a foreground service (default) at least on Android Oreo+.

Implementation

final bool startAsForegroundService;