Fix the IndexOutOfBoundsException when creating output media item list
The current implementation of building the output media item list keeps all media items in a single list. They try to mark the position of the original divider items and insert them back to the original position. However, the list of media devices might change due to various reasons. So inserting the original divider items back to the same position as the original media item list could cause the IndexOutOfBoundsException. To fix this issue, we create three separated media item lists to store selected media items, suggested media items, and other speakers and displays media items correspondingly. Then we insert the divider items when creating the output media item list. Flag: com.android.media.flags.fix_output_media_item_list_index_out_of_bounds_exception Bug: b/400241830 Test: manual test and presubmit Change-Id: I05026adaaae974e8271cb6d74d026da8c3593a4f
Loading
Please register or sign in to comment