File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -53,9 +53,11 @@ async function ensureNotificationPermission() {
5353 }
5454}
5555
56- // On Android 14+ (API 34+), FOREGROUND_SERVICE_MICROPHONE requires RECORD_AUDIO
57- // FOREGROUND_SERVICE_MICROPHONE is automatically granted when RECORD_AUDIO is granted
58- // We must ensure RECORD_AUDIO is granted BEFORE starting the foreground service
56+ // On Android 14+ (API 34+), FOREGROUND_SERVICE_MICROPHONE is a separate manifest permission
57+ // with normal protection level (auto-granted at install time), but it does NOT replace RECORD_AUDIO.
58+ // The manifest must declare FOREGROUND_SERVICE_MICROPHONE, and the app must request/obtain
59+ // RECORD_AUDIO as a runtime permission BEFORE starting the foreground service.
60+ // RECORD_AUDIO remains a dangerous permission that must be requested at runtime.
5961async function ensureForegroundServiceMicPermission ( ) {
6062 if ( Platform . OS !== 'android' || Platform . Version < 34 ) {
6163 return true ;
@@ -76,7 +78,7 @@ async function ensureForegroundServiceMicPermission() {
7678 }
7779 }
7880
79- console . log ( '[AudioStreamer] RECORD_AUDIO permission granted. FOREGROUND_SERVICE_MICROPHONE should be automatically available .' ) ;
81+ console . log ( '[AudioStreamer] RECORD_AUDIO permission granted. FOREGROUND_SERVICE_MICROPHONE must be declared in manifest .' ) ;
8082 return true ;
8183 } catch ( error ) {
8284 console . error ( '[AudioStreamer] Error ensuring foreground service mic permission:' , error ) ;
You can’t perform that action at this time.
0 commit comments