Fix SysUI crash when locking while showing the Media Output Group dialog
This CL fixes a bug introduced by http://ag/15663086: When locking the phone while showing the Media Output Group dialog, SystemUI would crash because of a mismatch between MediaOutputAdapter.currentActivePosition and MediaOutputController.mMediaDevices. That mismatch came from the sharing of the controller between the 2 dialogs, that are now shown at the same time (even though one is hidden). Starting from this CL, both dialogs now use a separate instance of MediaOutputController to avoid this kind of race condition. This CL also adds a safeguard in MediaOutputBaseDialog to ensure that we notify an item change within bounds, which would otherwise throw and crash. Bug: 200781817 Test: Show media output group dialog then lock phone. Change-Id: I7749cc963a5e145467b32aa3a9efb1e80009f324
Loading
Please register or sign in to comment