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:
1 parent
b8fc998679
commit
1b9fd985d4
12 files changed
+42
-24
No files matched your search
@@ -90,6 +90,7 @@ import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Utility class which maintains an instance of Launcher database and provides utility methods
|
||||
@@ -377,7 +378,7 @@ public class ModelDbController {
|
||||
// to run in grid migration based on if that grid already existed before migration or not.
|
||||
List<String> existingDBs = LauncherFiles.GRID_DB_FILES.stream()
|
||||
.filter(dbName -> mContext.getDatabasePath(dbName).exists())
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
mOpenHelper = (mContext instanceof SandboxContext) ? oldHelper
|
||||
: createDatabaseHelper(true, new DeviceGridState(idp).getDbFile());
|
||||
@@ -460,7 +461,7 @@ public class ModelDbController {
|
||||
// to run in grid migration based on if that grid already existed before migration or not.
|
||||
List<String> existingDBs = LauncherFiles.GRID_DB_FILES.stream()
|
||||
.filter(dbName -> mContext.getDatabasePath(dbName).exists())
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
mOpenHelper = (mContext instanceof SandboxContext) ? oldHelper
|
||||
: createDatabaseHelper(true /* forMigration */, targetDbName);
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user