Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cf6d7cb authored by Cole Faust's avatar Cole Faust
Browse files

Replace .toList() with .collect()

.toList() was only introduced to android in api level 24, 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: Id5fc63f50dd3d86ca211e430da2ed0bed267ec7a
parent fee19dee
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
import java.util.function.Consumer;
import java.util.stream.Collectors;

import javax.annotation.Nullable;

@@ -1029,9 +1030,10 @@ public abstract class AbstractActionHandler<T extends FragmentActivity & CommonA
                Collection<RootInfo> rootList = new ArrayList<>();
                if (root == null || root.isRecents()) {
                    // TODO(b:381346575): Pass roots based on user selection.
                    rootList.addAll(mProviders.getMatchingRootsBlocking(mState).stream().filter(
                            r -> r.supportsSearch() && r.authority != null
                                    && r.rootId != null).toList());
                    rootList.addAll(mProviders.getMatchingRootsBlocking(mState).stream()
                            .filter(r -> r.supportsSearch() && r.authority != null
                                    && r.rootId != null)
                            .collect(Collectors.toList()));
                } else {
                    rootList.add(root);
                }