From 49c15f81c9cb51fef5cf6f8140d13f12911670eb Mon Sep 17 00:00:00 2001 From: ifsnow Date: Sat, 24 Apr 2021 07:00:13 +0900 Subject: [PATCH] fix(app, android): avoid API24-only APIs, fix Android < 7 crash from 11.3.0 (#5206) --- .../firebase/common/TaskExecutorService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/app/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java b/packages/app/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java index ef7e935421..551add9859 100644 --- a/packages/app/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java +++ b/packages/app/android/src/main/java/io/invertase/firebase/common/TaskExecutorService.java @@ -101,12 +101,13 @@ public String getExecutorName(boolean isTransactional, String identifier) { public void shutdown() { Set existingExecutorNames = executors.keySet(); - existingExecutorNames.removeIf((executorName) -> { - return executorName.startsWith(name) == false; - }); - existingExecutorNames.forEach((executorName) -> { - removeExecutor(executorName); - }); + for (String executorName : existingExecutorNames) { + if (executorName.startsWith(name) == false) { + existingExecutorNames.remove(executorName); + } else { + removeExecutor(executorName); + } + } } public void removeExecutor(String executorName) {