Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,18 @@ class HotwordService : Service(), VoskRecognitionListener {
}
} catch (e: IllegalStateException) {
Log.e(TAG, "Background execution limits prevented starting HotwordService: ${e.message}", e)
context.stopService(intent)
try {
context.stopService(intent)
} catch (e2: Exception) {
Log.e(TAG, "Failed to stopService in IllegalStateException handler", e2)
}
} catch (e: SecurityException) {
Log.e(TAG, "Security limits prevented starting HotwordService: ${e.message}", e)
context.stopService(intent)
try {
context.stopService(intent)
} catch (e2: Exception) {
Log.e(TAG, "Failed to stopService in SecurityException handler", e2)
}
} catch (e: Exception) {
Log.e(TAG, "Failed to start HotwordService: ${e.message}", e)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,18 @@ class NodeForegroundService : Service() {
context.startService(intent)
} catch (e: IllegalStateException) {
android.util.Log.w(TAG, "Failed to send ACTION_STOP via startService, falling back to stopService", e)
context.stopService(intent)
try {
context.stopService(intent)
} catch (stopEx: Exception) {
android.util.Log.e(TAG, "Failed to stopService in IllegalStateException handler", stopEx)
}
} catch (e: SecurityException) {
android.util.Log.w(TAG, "Failed to send ACTION_STOP via startService, falling back to stopService", e)
context.stopService(intent)
try {
context.stopService(intent)
} catch (stopEx: Exception) {
android.util.Log.e(TAG, "Failed to stopService in SecurityException handler", stopEx)
}
} catch (e: Exception) {
android.util.Log.w(TAG, "Failed to send ACTION_STOP via startService, falling back to stopService", e)
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,18 @@ class SessionForegroundService : Service() {
}
} catch (e: IllegalStateException) {
Log.e(TAG, "Background execution limits prevented starting SessionForegroundService: ${e.message}", e)
context.stopService(intent)
try {
context.stopService(intent)
} catch (e2: Exception) {
Log.e(TAG, "Failed to stopService in IllegalStateException handler", e2)
}
} catch (e: SecurityException) {
Log.e(TAG, "Security limits prevented starting SessionForegroundService: ${e.message}", e)
context.stopService(intent)
try {
context.stopService(intent)
} catch (e2: Exception) {
Log.e(TAG, "Failed to stopService in SecurityException handler", e2)
}
} catch (e: Exception) {
Log.e(TAG, "Failed to start SessionForegroundService: ${e.message}", e)
}
Expand Down
Loading