Optimize attaching / detaching audio mixes.
Bug: 278045109 Test: atest AudioHostTest Change-Id: I5fe032b12c0ff02ac65790a78f5f3cf329c01d55
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user