From 372a799d2a1de159910f6d6bd3d3fd616219d675 Mon Sep 17 00:00:00 2001 From: Nick Patrick Date: Thu, 14 Mar 2024 08:35:01 -0400 Subject: [PATCH] pass service type --- sdk/build.gradle | 2 +- sdk/src/main/java/io/radar/sdk/RadarForegroundService.kt | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sdk/build.gradle b/sdk/build.gradle index f7ae41fe3..cbf40d0a3 100644 --- a/sdk/build.gradle +++ b/sdk/build.gradle @@ -10,7 +10,7 @@ apply plugin: "org.jetbrains.dokka" apply plugin: 'io.radar.mvnpublish' ext { - radarVersion = '3.9.7' + radarVersion = '3.9.8-beta.1' } String buildNumber = ".${System.currentTimeMillis()}" diff --git a/sdk/src/main/java/io/radar/sdk/RadarForegroundService.kt b/sdk/src/main/java/io/radar/sdk/RadarForegroundService.kt index 283039846..4cae5f40e 100644 --- a/sdk/src/main/java/io/radar/sdk/RadarForegroundService.kt +++ b/sdk/src/main/java/io/radar/sdk/RadarForegroundService.kt @@ -2,6 +2,7 @@ package io.radar.sdk import android.app.* import android.content.Intent +import android.content.pm.ServiceInfo import android.graphics.Color import android.os.Build import android.os.Bundle @@ -94,7 +95,11 @@ class RadarForegroundService : Service() { logger.e("Error setting foreground service content intent", RadarLogType.SDK_EXCEPTION, e) } val notification = builder.build() - startForeground(id, notification) + if (Build.VERSION.SDK_INT >= 29) { + startForeground(id, notification, ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION) + } else { + startForeground(id, notification) + } } override fun onBind(intent: Intent): IBinder? {