Replace .toList() with .collect()

.toList() was only introduced to android in api level 34, which is newer than
this module's min_sdk_version. Replace it with .collect().

This was found while updating android lint.

Flag: EXEMPT refactor
Bug: 394096385
Test: Presubmits
Change-Id: Id8d1de1531b67a7daf448e45592b7ef78f685fc2
This commit is contained in:
Cole Faust committed 2025-02-03 14:19:12 -08:00
1 parent b8fc998679
commit 1b9fd985d4
12 files changed
+42 -24

No files matched your search

@@ -390,8 +390,9 @@ public class BaseLauncherBinder {
ModelWriter writer = mApp.getModel()
.getWriter(false /* verifyChanges */, CellPosMapper.DEFAULT, null);
List<Pair<ItemInfo, View>> bindItems = items.stream().map(i ->
Pair.create(i, inflater.inflateItem(i, writer, null))).toList();
List<Pair<ItemInfo, View>> bindItems = items.stream()
.map(i -> Pair.create(i, inflater.inflateItem(i, writer, null)))
.collect(Collectors.toList());
executeCallbacksTask(c -> c.bindInflatedItems(bindItems), executor);
}