I have implemented a version of the SilentVoiceRecognitionService.
However, I have an issue with the Service not being shutdown properly to the extent that the next time the application is started, the service throws a ERROR_RECOGNIZER_BUSY.
In case it helps, this is how my service is declated in the Manifest:
<service
android:name="com.xyz.SilentVoiceRecognitionService"
android:label="@string/app_name">
</service>
The SilentVoiceRecognitionService is started from the application main service (in onStartCommand):
public int onStartCommand(Intent intent, int flags, int startId) {
if (mLiveCard == null) {
[...]
startService(new Intent(this, SilentVoiceRecognitionService.class));
}
return START_STICKY;
}
That service is started once. Here's it declaration in the Manifest file:
<service
android:name="com.xyz.XYZService"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice_trigger_start" />
</service>
Does anyone have an idea why this SilentVoiceRecognitionService is not shutdown properly?