Skip to content

Commit b59be57

Browse files
committed
chore: update comment
1 parent e6252cd commit b59be57

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

app/app/hooks/useAudioStreamer.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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.
5961
async 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);

0 commit comments

Comments
 (0)