From cda502a767f77261b9a5e15172b7dc4ee3a04b86 Mon Sep 17 00:00:00 2001 From: Inhishonor Date: Fri, 21 Feb 2025 13:42:45 -0800 Subject: [PATCH] Update Comments --- .../java/com/moez/QKSMS/feature/compose/ComposeActivity.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt index be17664a..e142c308 100644 --- a/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt +++ b/presentation/src/main/java/com/moez/QKSMS/feature/compose/ComposeActivity.kt @@ -220,7 +220,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { .autoDisposable(scope()) } private fun isSpeechRecognitionAvailable(): Boolean { - // Check if there is a speech recognition service available + // Check if there is a speech recognition service available, in Android 13 and up val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) val packageManager = this.packageManager val activities: List @@ -231,7 +231,7 @@ class ComposeActivity : QkThemedActivity(), ComposeView { PackageManager.ResolveInfoFlags.of(PackageManager.MATCH_DEFAULT_ONLY.toLong()) ) } else { -// else, pre-tiramisu versions +// else, pre-tiramisu/Android 13 and earlier val intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) activities = packageManager.queryIntentActivities(intent, 0) } @@ -676,7 +676,6 @@ class ComposeActivity : QkThemedActivity(), ComposeView { ComposeView.SpeechRecognitionRequestCode ) } else { - // Display a message or handle the lack of STT provider in a way that suits your app Toast.makeText(this, getString(R.string.stt_toast_no_provider), Toast.LENGTH_SHORT).show() } }