Skip to content

Commit 88c78fc

Browse files
authored
Fix foreground service type (#3857)
Closes #3855 Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
1 parent 760ad73 commit 88c78fc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mobile/src/main/java/org/openhab/habdroid/background/ItemUpdateWorker.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
package org.openhab.habdroid.background
1515

1616
import android.content.Context
17-
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
17+
import android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
1818
import android.os.Parcelable
1919
import android.util.Log
2020
import android.widget.Toast
@@ -266,7 +266,11 @@ class ItemUpdateWorker(context: Context, params: WorkerParameters) : CoroutineWo
266266
.addAction(R.drawable.ic_clear_grey_24dp, context.getString(android.R.string.cancel), cancelIntent)
267267
.build()
268268

269-
return ForegroundInfo(NOTIFICATION_ID_BACKGROUND_WORK_RUNNING, notification, FOREGROUND_SERVICE_TYPE_DATA_SYNC)
269+
return ForegroundInfo(
270+
NOTIFICATION_ID_BACKGROUND_WORK_RUNNING,
271+
notification,
272+
FOREGROUND_SERVICE_TYPE_SHORT_SERVICE
273+
)
270274
}
271275

272276
private fun buildOutputData(hasConnection: Boolean, httpStatus: Int, sentValue: String? = null): Data {

0 commit comments

Comments
 (0)