Declare microphone-related permissions for voice recording in AndroidManifest and handle runtime permission errors appropriately in Android app. Update versionCode to 133 and add localized strings for improved error messaging.

This commit is contained in:
MartinBraquet
2026-07-25 18:34:24 +02:00
parent 27b18e1d46
commit fb24068729
5 changed files with 27 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ android {
applicationId "com.compassconnections.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 132
versionCode 133
versionName "1.32.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {

View File

@@ -88,6 +88,18 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Voice auto-fill on the profile form. Capacitor's BridgeWebChromeClient already answers the
WebView's AUDIO_CAPTURE request by asking for these two at runtime, but Android silently
denies a runtime request for a permission that was never declared here — so getUserMedia
rejected with NotAllowedError and the web UI blamed the browser. -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<!-- Declaring RECORD_AUDIO implicitly marks android.hardware.microphone as required, which would
hide the app on Play from any device without a mic. Recording is one optional feature, so
keep distribution wide and let the UI degrade instead. -->
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove" />
<!-- Firebase Cloud Messaging -->

View File

@@ -1076,6 +1076,7 @@
"profile.voice.review_transcript": "Das haben wir gehört. Sie müssen nichts aufräumen: Ähs, Fehlstarts und die Stellen, an denen Sie sich mitten im Satz korrigiert haben, übernehmen wir für Sie — nichts davon landet in Ihrem Profil. Zu korrigieren lohnt sich nur, was wir falsch verstanden haben: Namen und Orte sind die üblichen Verdächtigen.",
"profile.voice.fill_profile": "Mein Profil ausfüllen",
"profile.voice.error.permission": "Wir konnten nicht auf Ihr Mikrofon zugreifen. Erlauben Sie den Mikrofonzugriff in Ihrem Browser, und versuchen Sie es erneut.",
"profile.voice.error.permission_app": "Wir konnten nicht auf Ihr Mikrofon zugreifen. Erlauben Sie die Mikrofon-Berechtigung für Compass in Ihren Geräteeinstellungen, und versuchen Sie es erneut.",
"profile.voice.error.unsupported": "Ihr Browser unterstützt keine Sprachaufnahme. Nutzen Sie stattdessen die Option Link oder Text.",
"profile.voice.error.failed": "Die Aufnahme ist fehlgeschlagen. Bitte versuchen Sie es erneut.",
"profile.voice.error.transcription": "Wir konnten Ihre Aufnahme nicht transkribieren. Sie ist noch da — versuchen Sie es erneut, oder füllen Sie Ihr Profil manuell aus.",

View File

@@ -1075,6 +1075,7 @@
"profile.voice.review_transcript": "Voici ce que nous avons entendu. Pas besoin de le nettoyer : les hésitations, les faux départs, les fois où vous avez changé d'avis en cours de phrase sont gérés pour vous, et rien de tout cela ne se retrouvera sur votre profil. La seule chose à corriger, c'est ce que nous avons mal entendu : les noms et les lieux sont les suspects habituels.",
"profile.voice.fill_profile": "Remplir mon profil",
"profile.voice.error.permission": "Nous n'avons pas pu accéder à votre microphone. Autorisez l'accès au microphone dans votre navigateur, puis réessayez.",
"profile.voice.error.permission_app": "Nous n'avons pas pu accéder à votre microphone. Autorisez la permission Microphone pour Compass dans les réglages de votre appareil, puis réessayez.",
"profile.voice.error.unsupported": "Votre navigateur ne prend pas en charge l'enregistrement vocal. Essayez plutôt l'option lien ou texte.",
"profile.voice.error.failed": "L'enregistrement a échoué. Veuillez réessayer.",
"profile.voice.error.transcription": "Nous n'avons pas pu transcrire votre enregistrement. Il est toujours là — réessayez, ou remplissez votre profil manuellement.",

View File

@@ -20,6 +20,7 @@ import {
savePendingRecording,
savePendingTranscript,
} from 'web/lib/util/recording-store'
import {isAndroidApp} from 'web/lib/util/webview'
function formatTime(totalSeconds: number) {
const minutes = Math.floor(totalSeconds / 60)
@@ -119,10 +120,17 @@ export function VoiceAutofillSection(props: {
const errorMessage =
recorder.error === 'permission'
? t(
'profile.voice.error.permission',
'We could not access your microphone. Allow microphone access in your browser, then try again.',
)
? // In the Android app there is no browser to change a setting in: the prompt is Android's, and
// once denied it can only be undone from the app's own permission screen.
isAndroidApp()
? t(
'profile.voice.error.permission_app',
'We could not access your microphone. Allow the Microphone permission for Compass in your device settings, then try again.',
)
: t(
'profile.voice.error.permission',
'We could not access your microphone. Allow microphone access in your browser, then try again.',
)
: recorder.error === 'unsupported'
? t(
'profile.voice.error.unsupported',