app/src/main/java/com/example/jarvis_stts/JarvisService.kt aktualisiert
This commit is contained in:
@@ -38,11 +38,11 @@ class JarvisService : Service(), RecognitionListener {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
||||||
startForeground(
|
startForeground(
|
||||||
1,
|
1,
|
||||||
createNotification("J.A.R.V.I.S. hört zu..."),
|
createNotification("JARVIS hört zu..."),
|
||||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
|
ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
startForeground(1, createNotification("J.A.R.V.I.S. hört zu..."))
|
startForeground(1, createNotification("JARVIS hört zu..."))
|
||||||
}
|
}
|
||||||
|
|
||||||
initVosk()
|
initVosk()
|
||||||
@@ -61,7 +61,7 @@ class JarvisService : Service(), RecognitionListener {
|
|||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
val channel = NotificationChannel(
|
val channel = NotificationChannel(
|
||||||
CHANNEL_ID,
|
CHANNEL_ID,
|
||||||
"J.A.R.V.I.S. Background Service",
|
"JARVIS Background Service",
|
||||||
NotificationManager.IMPORTANCE_LOW
|
NotificationManager.IMPORTANCE_LOW
|
||||||
)
|
)
|
||||||
val manager = getSystemService(NotificationManager::class.java)
|
val manager = getSystemService(NotificationManager::class.java)
|
||||||
@@ -76,7 +76,7 @@ class JarvisService : Service(), RecognitionListener {
|
|||||||
)
|
)
|
||||||
|
|
||||||
return NotificationCompat.Builder(this, CHANNEL_ID)
|
return NotificationCompat.Builder(this, CHANNEL_ID)
|
||||||
.setContentTitle("J.A.R.V.I.S. ist aktiv")
|
.setContentTitle("JARVIS ist aktiv")
|
||||||
.setContentText(text)
|
.setContentText(text)
|
||||||
.setSmallIcon(android.R.drawable.ic_btn_speak_now) // Standard Android Icon
|
.setSmallIcon(android.R.drawable.ic_btn_speak_now) // Standard Android Icon
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
|
|||||||
Reference in New Issue
Block a user