From a0b9a08552897305a76e0d4225dcb7bae5d76a64 Mon Sep 17 00:00:00 2001 From: Gaston Thea Date: Thu, 7 Sep 2023 13:47:42 -0300 Subject: [PATCH] Fix --- .../java/io/split/android/client/SplitFactoryHelper.java | 2 +- .../client/service/synchronizer/WorkManagerWrapper.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/split/android/client/SplitFactoryHelper.java b/src/main/java/io/split/android/client/SplitFactoryHelper.java index e4c2fd4e7..83cb7a841 100644 --- a/src/main/java/io/split/android/client/SplitFactoryHelper.java +++ b/src/main/java/io/split/android/client/SplitFactoryHelper.java @@ -191,7 +191,7 @@ SplitApiFacade buildApiFacade(SplitClientConfig splitClientConfig, WorkManagerWrapper buildWorkManagerWrapper(Context context, SplitClientConfig splitClientConfig, String apiKey, String databaseName, List filters) { return new WorkManagerWrapper( - WorkManager.getInstance(context), splitClientConfig, apiKey, databaseName, (filters != null && filters.size() == 1) ? filters.get(0) : null); + WorkManager.getInstance(context), splitClientConfig, apiKey, databaseName, filters); } diff --git a/src/main/java/io/split/android/client/service/synchronizer/WorkManagerWrapper.java b/src/main/java/io/split/android/client/service/synchronizer/WorkManagerWrapper.java index 07a60bc02..b2beb4b08 100644 --- a/src/main/java/io/split/android/client/service/synchronizer/WorkManagerWrapper.java +++ b/src/main/java/io/split/android/client/service/synchronizer/WorkManagerWrapper.java @@ -46,20 +46,21 @@ public class WorkManagerWrapper implements MySegmentsWorkManagerWrapper { // This variable is used to avoid loading data first time // we receive enqueued event private final Set mShouldLoadFromLocal; + @Nullable private final SplitFilter mFilter; public WorkManagerWrapper(@NonNull WorkManager workManager, @NonNull SplitClientConfig splitClientConfig, @NonNull String apiKey, @NonNull String databaseName, - @Nullable SplitFilter filter) { + @Nullable List filters) { mWorkManager = checkNotNull(workManager); mDatabaseName = checkNotNull(databaseName); mSplitClientConfig = checkNotNull(splitClientConfig); mApiKey = checkNotNull(apiKey); mShouldLoadFromLocal = new HashSet<>(); mConstraints = buildConstraints(); - mFilter = filter; + mFilter = (filters != null && filters.size() == 1) ? filters.get(0) : null; } public void setFetcherExecutionListener(SplitTaskExecutionListener fetcherExecutionListener) {