Merge "Fix crash issue on Storage Manager app"

This commit is contained in:
Treehugger Robot
2017-03-20 17:05:18 +00:00
committed by Gerrit Code Review

View File

@@ -649,7 +649,11 @@ public class ApplicationsState {
} }
if (comparator != null) { if (comparator != null) {
Collections.sort(filteredApps, comparator); synchronized (mEntriesMap) {
// Locking to ensure that the background handler does not mutate
// the size of AppEntries used for ordering while sorting.
Collections.sort(filteredApps, comparator);
}
} }
synchronized (mRebuildSync) { synchronized (mRebuildSync) {