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

Commit 5cdf762b authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Reset audio port generation when having recording callback event." into...

Merge "Reset audio port generation when having recording callback event." into rvc-dev am: 2b5ba928 am: 520d7fae

Change-Id: I1a81b0b4ad9b21d866da5b50b7940773a83a447c
parents 6f718ea2 520d7fae
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -686,6 +686,23 @@ public class AudioSystem
        String effectName =  effects.length == 0 ? "None" : effects[0].name;

        if (cb != null) {
            ArrayList<AudioPatch> audioPatches = new ArrayList<>();
            if (AudioManager.listAudioPatches(audioPatches) == AudioManager.SUCCESS) {
                boolean patchFound = false;
                int patchHandle = recordingFormat[6];
                for (AudioPatch patch : audioPatches) {
                    if (patch.id() == patchHandle) {
                        patchFound = true;
                        break;
                    }
                }
                if (!patchFound) {
                    // The cached audio patches in AudioManager is not up-to-date.
                    // Reset audio port generation to ensure callback side can
                    // get up-to-date audio port information.
                    AudioManager.resetAudioPortGeneration();
                }
            }
            // TODO receive package name from native
            cb.onRecordingConfigurationChanged(event, riid, uid, session, source, portId, silenced,
                                        recordingFormat, clientEffects, effects, activeSource, "");