[DocsUI] Fix the selection not in sync bug
If some files are already in selected state, and the model update
removes these files from the result (e.g. files get deleted),
previously the files were just removed from the selection list
iterator directly, which wouldn't notify its observers, result in the
selection model and selection title ("X selected") not in sync.
This CL uses the selection manager's setItemsSelected(false) to
removes these files from the selection, which will also notify its
observers so the selection title can update.
Bug: 417863874
Test: atest DocumentsUIGoogleTests:com.android.documentsui.dirlist.DirectoryFragmentTest
Flag: EXEMPT bug fix
Change-Id: I208130673bdea796ee90980312cacd78ec98c860
Loading
Please register or sign in to comment