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

Commit 09885dc1 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

AudioManager: onPlaybackConfigChanged called w/ latest config

When AudioService sends new playback configurations, they are
enqueued into the Handler of the registered callback.
Whenever a new config is received, discard unhandled messages and
enqueue the new one, instead of just queueing: clients only
need the new state.

Bug: 361092797
Flag: EXEMPT bug fix
Test: atest AudioPlaybackConfigurationTest
Change-Id: I54e6cc997dcbb5c1684acc1acd82b1f7bae50eeb
parent fe9528bc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -5881,6 +5881,8 @@ public class AudioManager {
                            final Message m = arci.mHandler.obtainMessage(
                                    MSSG_PLAYBACK_CONFIG_CHANGE/*what*/,
                                    new PlaybackConfigChangeCallbackData(arci.mCb, configs)/*obj*/);
                            // only the last config matters, discard unprocessed ones
                            arci.mHandler.removeMessages(MSSG_PLAYBACK_CONFIG_CHANGE);
                            arci.mHandler.sendMessage(m);
                        }
                    }