Skip to content

Commit

Permalink
Merge pull request #2732 from dimagi/asyncEntityRefactor
Browse files Browse the repository at this point in the history
Moves Async entity Implementation to Core
  • Loading branch information
shubham1g5 committed Apr 10, 2024
2 parents a79691b + d54fe91 commit 4637f56
Show file tree
Hide file tree
Showing 16 changed files with 162 additions and 581 deletions.
6 changes: 3 additions & 3 deletions app/src/org/commcare/CommCareApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
import org.commcare.models.database.MigrationException;
import org.commcare.models.database.SqlStorage;
import org.commcare.models.database.global.DatabaseGlobalOpenHelper;
import org.commcare.models.database.user.models.EntityStorageCache;
import org.commcare.models.database.user.models.CommCareEntityStorageCache;
import org.commcare.models.legacy.LegacyInstallUtils;
import org.commcare.modern.database.Table;
import org.commcare.modern.session.SessionWrapper;
Expand Down Expand Up @@ -780,8 +780,8 @@ public void onServiceConnected(ComponentName className, IBinder service) {
PurgeStaleArchivedFormsTask.launchPurgeTask();
}

if (EntityStorageCache.getEntityCacheWipedPref(user.getUniqueId()) < ReportingUtils.getAppVersion()) {
EntityStorageCache.wipeCacheForCurrentApp();
if (CommCareEntityStorageCache.getEntityCacheWipedPref(user.getUniqueId()) < ReportingUtils.getAppVersion()) {
CommCareEntityStorageCache.wipeCacheForCurrentApp();
}

purgeLogs();
Expand Down
5 changes: 3 additions & 2 deletions app/src/org/commcare/adapters/EntityListAdapter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.commcare.adapters;

import static org.commcare.cases.util.StringUtils.normalize;

import android.database.DataSetObserver;
import android.view.LayoutInflater;
import android.view.View;
Expand All @@ -20,7 +22,6 @@
import org.commcare.suite.model.Detail;
import org.commcare.utils.AndroidUtil;
import org.commcare.utils.CachingAsyncImageLoader;
import org.commcare.utils.StringUtils;
import org.commcare.views.EntityActionViewUtils;
import org.commcare.views.EntityView;
import org.commcare.views.EntityViewTile;
Expand Down Expand Up @@ -311,7 +312,7 @@ public synchronized void filterByString(String filterRaw) {
// split by whitespace
String[] searchTerms = filterRaw.split("\\s+");
for (int i = 0; i < searchTerms.length; ++i) {
searchTerms[i] = StringUtils.normalize(searchTerms[i]);
searchTerms[i] = normalize(searchTerms[i]);
}
currentSearchTerms = searchTerms;
searchQuery = filterRaw;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.commcare.interfaces;

import org.commcare.CommCareApplication;
import org.commcare.cases.entity.AsyncNodeEntityFactory;
import org.commcare.cases.entity.Entity;
import org.commcare.cases.entity.NodeEntityFactory;
import org.commcare.cases.entity.SortableEntityAdapter;
import org.commcare.models.AsyncNodeEntityFactory;
import org.commcare.suite.model.Detail;
import org.commcare.views.notifications.NotificationMessageFactory;
import org.javarosa.core.model.instance.TreeReference;
Expand Down
254 changes: 0 additions & 254 deletions app/src/org/commcare/models/AsyncEntity.java

This file was deleted.

Loading

0 comments on commit 4637f56

Please sign in to comment.