Skip to content
Snippets Groups Projects
Commit 5031e339 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

services: handle onTimeout

Change-Id: I87a3b2162e6f28cda1def80ac1986d2ff11a6ee5
parent 1f48fe41
No related branches found
No related tags found
No related merge requests found
......@@ -105,6 +105,17 @@ class SyncService : Service() {
}
}
override fun onTimeout(startId: Int, fgsType: Int) {
Log.w(TAG, "onTimeout: startId=$startId, fgsType=$fgsType")
try {
stopForeground(true)
stopSelf()
} catch (ignored: IllegalStateException) {
}
notification = null
serviceUsers = 0
}
override fun onBind(intent: Intent): IBinder? = null
companion object {
......
......@@ -109,6 +109,14 @@ class DataTransferService : Service() {
super.onCreate()
}
override fun onTimeout(startId: Int, fgsType: Int) {
try {
stopForeground(true)
stopSelf()
} catch (ignored: IllegalStateException) {
}
}
override fun onDestroy() {
Log.d(TAG, "OnDestroy(), DataTransferService has been destroyed")
super.onDestroy()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment