setForeground

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+.

Return

the builder

Parameters

foreground

whether the service should be started in foreground state.