Skip to content

Commit

Permalink
Improve manifest metadata for STT service
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Jul 26, 2024
1 parent 45cd9e3 commit 726f2d4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
18 changes: 5 additions & 13 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />

<queries>
<!-- To access Speech recognizer via system interface on Android 11+
https://developer.android.com/reference/android/speech/SpeechRecognizer#createSpeechRecognizer(android.content.Context,%20android.content.ComponentName) -->
<intent>
<action
android:name="android.speech.RecognitionService" />
</intent>
</queries>

<!-- allowBackup=false because of a critical nasty bug: https://medium.com/p/924c91bafcac -->
<application
android:name=".App"
Expand Down Expand Up @@ -88,12 +79,13 @@

<service
android:name=".io.input.stt_service.SttService"
android:enabled="true"
android:description="@string/stt_service_label"
android:directBootAware="true"
android:exported="true"
android:description="@string/pref_input_method_vosk"
android:foregroundServiceType="microphone"
android:icon="@mipmap/ic_launcher"
android:directBootAware="true"
android:foregroundServiceType="microphone">
android:label="@string/stt_service_label"
android:permission="android.permission.RECORD_AUDIO">
<intent-filter>
<action android:name="android.speech.RecognitionService"/>
<category android:name="android.intent.category.DEFAULT" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class SttService : RecognitionService() {
}

if (!willStartListening) {
Log.w(TAG, "Could not start STT recognizer")
logRemoteExceptions { listener.error(ERROR_LANGUAGE_UNAVAILABLE) }
}
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,5 @@
<string name="skill_timer_query_name">Timer %1$s expires in %2$s</string>
<string name="skill_timer_query_last">The last timer expires in %1$s</string>
<string name="skill_timer_none_canceled">OK, no timer was canceled</string>
<string name="stt_service_label">Dicio offline speech recognition</string>
</resources>

0 comments on commit 726f2d4

Please sign in to comment.