Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3cbafbdb authored by jiabin's avatar jiabin Committed by Jiabin Huang
Browse files

Update logic to set legacy remote submix rrid.

1. Only record legacy remote submix information when the recording event
is START or UPDATE.
2. The AudioDeviceInfo returned from AudioRecordingConfiguration may be
null. Check if the audio device info is null or not to avoid NPE.

Test: make
Test: volume adjustable on chromecast mirror mode when enabling LC
Bug: 152796386
Change-Id: Ibf9d5dd0d8a59339ca9c0c7547b84d033ed9bfd0
parent c068acb6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -150,16 +150,16 @@ public final class RecordingActivityMonitor implements AudioSystem.AudioRecordin
        final AudioRecordingConfiguration config = createRecordingConfiguration(
                uid, session, source, recordingInfo,
                portId, silenced, activeSource, clientEffects, effects);
        if (source == MediaRecorder.AudioSource.REMOTE_SUBMIX) {
        if (source == MediaRecorder.AudioSource.REMOTE_SUBMIX
                && (event == AudioManager.RECORD_CONFIG_EVENT_START
                        || event == AudioManager.RECORD_CONFIG_EVENT_UPDATE)) {
            final AudioDeviceInfo device = config.getAudioDevice();
            if (AudioSystem.LEGACY_REMOTE_SUBMIX_ADDRESS.equals(device.getAddress())) {
            if (device != null
                    && AudioSystem.LEGACY_REMOTE_SUBMIX_ADDRESS.equals(device.getAddress())) {
                mLegacyRemoteSubmixRiid.set(riid);
                if (event == AudioManager.RECORD_CONFIG_EVENT_START
                        || event == AudioManager.RECORD_CONFIG_EVENT_UPDATE) {
                mLegacyRemoteSubmixActive.set(true);
            }
        }
        }
        if (MediaRecorder.isSystemOnlyAudioSource(source)) {
            // still want to log event, it just won't appear in recording configurations;
            sEventLogger.log(new RecordingEvent(event, riid, config).printLog(TAG));