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) {