Repository navigation
Conversation
…iptions - AudioRouteEvents is the one subscription to device add/remove, the communication-device change (12+) and the SCO audio broadcast; MediaSessionManager.RouteEventDispatch hands each event to the input router, the communication session and the JS routeChange emitter. Replaces DeviceChangeListener, CommunicationDeviceCallbacks and the listeners BluetoothScoLink registered itself. An active communication session no longer emits each device change twice or a spurious NewDeviceAvailable on activation. - SystemSubscription / BroadcastSubscription: idempotent register and unregister; MediaSessionManager keeps them in one list that cleanup() unregisters. - MediaSessionManager.initialize split into notifications, audio session and routing steps; shared permission status check, getDevicesInfo built from one device-array helper. - NotificationRegistry tracks active notifications as a set and creates them through getOrPut. - AudioFocusListener and VolumeChangeListener send their events through one helper each; the volume event reuses getSystemVolume (0 instead of NaN when the stream maximum is 0). - AudioAPIModule drops its unused LifecycleEventListener. - Every logcat tag starts with "RNAudioAPI." (LogTag.PREFIX in Kotlin, RN_AUDIO_API_LOG_TAG in C++). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uting and session classes Pure move: AudioInputRouter, BluetoothScoLink, AudioRouteEvents and RouteChangeReason go to system/routing; AudioFocusListener, CommunicationSession and VolumeChangeListener to system/session. MediaSessionManager held no media session, so it is now AudioSystem. Classes named in JNI descriptors (NativeInputRouting, NativeRecorderControl, NativeFileInfo) and in consuming apps' manifests (CentralizedForegroundService) stay in system. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… session and routing AudioSystem is wiring only: it builds AudioPermissions, AudioNotifications, AudioSession and AudioRouting, registers their module-lifetime subscriptions as one list, and releases session, subscriptions, then routing on cleanup, in the same order as before. - AudioSession owns focus, the communication session, volume and the main-thread posting its callers relied on. - AudioRouting owns the input router, the route-event dispatch and devicesInfo; it depends on the session, never the reverse. - AudioNotifications owns the channel, the registry and the playback receiver; CHANNEL_ID moves there. Receivers and the foreground service, which Android can start before initialize, use notificationsIfReady. - AudioDeviceDescriptions builds the device maps JS receives. No behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AudioEventEmitter wraps the module's weak reference and is the only caller of invokeHandlerWithEventNameAndEventBody. Focus, volume, route, playback and recording notification events go through it, so no component holds AudioAPIModule. PlaybackNotificationReceiver takes the emitter in its constructor instead of a static strong reference to the module, and RecordingNotification no longer throws when the module is already gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…session CommunicationSession (speaker / earpiece) and BluetoothScoLink (a headset mic's SCO device) both set and cleared the communication device without knowing of each other: the end of a headset-mic recording cleared the session's speaker request, and activating or deactivating a session during such a recording took its SCO link away, which the recorder then fought back for. CommunicationRoute is now the only caller of setCommunicationDevice / clearCommunicationDevice. It keeps both requests; the recording's wins, the session's is kept meanwhile and re-applied when the recording ends, and the device is cleared only when neither holds one. A session request made during the recording resolves at once and takes effect afterwards. Below Android 12 nothing changes: there is no communication device and no session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Introduced changes
CommunicationSession.ktandBluetoothScoLink.ktfighting for the system communication deviceRNAudioAPIsign in the tag so it can be easily recognized and connected to usFor now draft, because I do not have an access to the physical android and i can't test the bluetooth connection and reroute handling
Checklist
release/X.Yonly for fixes to the released version)Summary by CodeRabbit