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

Commit b98f86f3 authored by Jan Sebechlebsky's avatar Jan Sebechlebsky
Browse files

Optimize attaching / detaching audio mixes.

Bug: 278045109
Test: atest AudioHostTest
Change-Id: I5fe032b12c0ff02ac65790a78f5f3cf329c01d55
parent 844c5aec
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -12429,20 +12429,16 @@ public class AudioService extends IAudioService.Stub
        }
        int addMixes(@NonNull ArrayList<AudioMix> mixes) {
            // TODO optimize to not have to unregister the mixes already in place
            synchronized (mMixes) {
                mAudioSystem.registerPolicyMixes(mMixes, false);
                this.add(mixes);
                return mAudioSystem.registerPolicyMixes(mMixes, true);
                return mAudioSystem.registerPolicyMixes(mixes, true);
            }
        }
        int removeMixes(@NonNull ArrayList<AudioMix> mixes) {
            // TODO optimize to not have to unregister the mixes already in place
            synchronized (mMixes) {
                mAudioSystem.registerPolicyMixes(mMixes, false);
                this.remove(mixes);
                return mAudioSystem.registerPolicyMixes(mMixes, true);
                return mAudioSystem.registerPolicyMixes(mixes, false);
            }
        }