package top.yeij.cyrene.service

import android.service.voice.VoiceInteractionService
import android.util.Log

/**
 * Recognition service for always-on hotword detection.
 *
 * In API 36, AlwaysOnHotwordDetector was removed from the public SDK.
 * The system manages low-level hotword detection internally and invokes
 * the session service declared in voice_interaction_config.xml when triggered.
 * For custom hotword models (Porcupine / openWakeWord), integrate via
 * a foreground service with microphone capture instead.
 */
class CyreneRecognitionService : VoiceInteractionService() {

    override fun onReady() {
        super.onReady()
        isActive = true
        Log.i(TAG, "Recognition service ready")
    }

    override fun onShutdown() {
        isActive = false
        super.onShutdown()
    }

    companion object {
        private const val TAG = "CyreneRecognition"
        var isActive: Boolean = false
            private set
    }
}
