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

Commit f012564c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Create a copy of the key set before starting streaming over mAutoTransactPatterns" into main

parents 917065f9 50948eb3
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -585,8 +585,15 @@ public final class ApduServiceInfo implements Parcelable {
            return true;
            return true;
        }
        }
        boolean isPattern = plf.contains("?") || plf.contains("*");
        boolean isPattern = plf.contains("?") || plf.contains("*");
        List<Pattern> patternMatches = mAutoTransactPatterns.keySet().stream().filter(

            p -> isPattern ? p.toString().equals(plf) : p.matcher(plf).matches()).toList();
        // Create a copy of the key set to avoid ConcurrentModificationException
        List<Pattern> patternKeys = new ArrayList<>(mAutoTransactPatterns.keySet());

        List<Pattern> patternMatches =
                patternKeys.stream()
                        .filter(p
                                -> isPattern ? p.toString().equals(plf) : p.matcher(plf).matches())
                        .toList();


        if (patternMatches == null || patternMatches.size() == 0) {
        if (patternMatches == null || patternMatches.size() == 0) {
            return false;
            return false;