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

Commit 67424760 authored by Abhishek Aggarwal's avatar Abhishek Aggarwal Committed by Mohammed Althaf T
Browse files

fix(folder): Concurrent exception

parent 44b6d9b3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -111,9 +111,10 @@ public class FolderNameProvider implements ResourceBasedOverride {
            Log.d(TAG, "getSuggestedFolderName:" + nameInfos.toString());
        }

        ArrayList<WorkspaceItemInfo> items = new ArrayList<>(workspaceItemInfos);
        // If all the icons are from work profile,
        // Then, suggest "Work" as the folder name
        Set<UserHandle> users = workspaceItemInfos.stream().map(w -> w.user)
        Set<UserHandle> users = items.stream().map(w -> w.user)
                .collect(Collectors.toSet());
        if (users.size() == 1 && !users.contains(Process.myUserHandle())) {
            setAsLastSuggestion(nameInfos, getWorkFolderName(context));
@@ -121,7 +122,7 @@ public class FolderNameProvider implements ResourceBasedOverride {

        // If all the icons are from same package (e.g., main icon, shortcut, shortcut)
        // Then, suggest the package's title as the folder name
        Set<String> packageNames = workspaceItemInfos.stream()
        Set<String> packageNames = items.stream()
                .map(WorkspaceItemInfo::getTargetComponent)
                .filter(Objects::nonNull)
                .map(ComponentName::getPackageName)