DO NOT MERGE: Downbranch merge conflict [Output Switcher] Behavior improvement

Use Lock when access MediaDevices in MediaOutputController as in
LocalMediaController, prevent devices changed while refreshing.
Sort devices in Controller to make sure the sequence is correct.
Add grouping state to make dynamic grouping has transition state.

Bug: 228511134
Bug: 228255441
Test: N/A
Change-Id: I4976176f3133e48c41a56d746861a9a4027f9a34
5 files changed