Fix duplicated roots are shown
Symptom:
Duplicated roots are shown in the drawer of DocumentsUI
Root cause:
ArrayListMultimap that allows duplicate key-value pairs is used for
mRoots. If the specific roots info are re-loaded with getRootOneshot(),
the duplicate roots info are put in mRoots and results in duplicated
roots are shown.
Solution:
Use replaceValues() instead of putAll() when re-loading roots for the
specific authority.
Bug: 73470276
Test: Manual
Test: Run instrumentation tests from com.android.documentsui.tests
Change-Id: Ia3f53fe2e5c36aa13f2cd6e0d5e39cec05aa4b28
1 file changed