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
2025-02-03 13:30:32 -08:00
parent b8fc998679
commit 1b9fd985d4
12 changed files with 42 additions and 24 deletions

View File

@@ -399,8 +399,9 @@ public class InvariantDeviceProfile implements SafeCloseable {
private List<DisplayOption> filterByColumnCount(
List<DisplayOption> allOptions, int numColumns) {
return allOptions.stream().filter(
option -> option.grid.numColumns == numColumns).toList();
return allOptions.stream()
.filter(option -> option.grid.numColumns == numColumns)
.collect(Collectors.toList());
}
/**