Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/org/commcare/CommCareApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
import org.commcare.network.DataPullResponseFactory;
import org.commcare.network.HttpUtils;
import org.commcare.network.OkHttpBuilderCustomConfig;
import org.commcare.pn.workermanager.NotificationsRetrievalWorkerManager;
import org.commcare.pn.workermanager.NotificationsSyncWorkerManager;
import org.commcare.preferences.DevSessionRestorer;
import org.commcare.preferences.DeveloperPreferences;
import org.commcare.preferences.HiddenPreferences;
Expand Down Expand Up @@ -275,7 +275,7 @@ public void onCreate() {
setRxJavaGlobalHandler();

ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
NotificationsRetrievalWorkerManager.schedulePeriodicPushNotificationRetrievalChecked(
NotificationsSyncWorkerManager.schedulePeriodicPushNotificationRetrievalChecked(
CommCareApplication.instance());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.commcare.android.database.connect.models.PushNotificationRecord
import org.commcare.connect.database.NotificationRecordDatabaseHelper
import org.commcare.pn.workermanager.PNApiSyncWorkerManager
import org.commcare.pn.workermanager.NotificationsSyncWorkerManager
import org.commcare.utils.PushNotificationApiHelper.retrieveLatestPushNotifications

class PushNotificationViewModel(application: Application) : AndroidViewModel(application) {
Expand Down Expand Up @@ -39,10 +39,10 @@ class PushNotificationViewModel(application: Application) : AndroidViewModel(app
val latestPushNotificationsFromApi = retrieveLatestPushNotifications(application)
latestPushNotificationsFromApi.onSuccess {
val currentNotifications = _allNotifications.value.orEmpty()
PNApiSyncWorkerManager(
NotificationsSyncWorkerManager(
application,
it,
PNApiSyncWorkerManager.SYNC_TYPE.NOTIFICATION_API
NotificationsSyncWorkerManager.SyncType.OTHER
).startPNApiSync()
val updatedNotifications = (it + currentNotifications).distinctBy { it.notificationId }.sortedByDescending { it.createdDate }
_isLoading.postValue(false)
Expand All @@ -54,4 +54,4 @@ class PushNotificationViewModel(application: Application) : AndroidViewModel(app

}
}
}
}
6 changes: 3 additions & 3 deletions app/src/org/commcare/connect/PersonalIdManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
import org.commcare.connect.network.TokenDeniedException;
import org.commcare.connect.network.TokenUnavailableException;
import org.commcare.connect.workers.ConnectHeartbeatWorker;
import org.commcare.pn.workermanager.NotificationsRetrievalWorkerManager;
import org.commcare.core.network.AuthInfo;
import org.commcare.dalvik.R;
import org.commcare.google.services.analytics.FirebaseAnalyticsUtil;
import org.commcare.pn.workermanager.NotificationsSyncWorkerManager;
import org.commcare.util.LogTypes;
import org.commcare.utils.BiometricsHelper;
import org.commcare.utils.CrashUtil;
Expand Down Expand Up @@ -206,7 +206,7 @@ private void logBiometricInvalidations() {
public void completeSignin() {
personalIdSatus = PersonalIdStatus.LoggedIn;
scheduleHeartbeat();
NotificationsRetrievalWorkerManager.INSTANCE.schedulePeriodicPushNotificationRetrieval(CommCareApplication.instance());
NotificationsSyncWorkerManager.schedulePeriodicPushNotificationRetrieval(CommCareApplication.instance());
CrashUtil.registerUserData();
}

Expand All @@ -226,7 +226,7 @@ public void forgetUser(String reason) {
personalIdSatus = PersonalIdStatus.NotIntroduced;

// Cancel periodic push notification retrieval when user logs out
NotificationsRetrievalWorkerManager.INSTANCE.cancelPeriodicPushNotificationRetrieval(CommCareApplication.instance());
NotificationsSyncWorkerManager.cancelPeriodicPushNotificationRetrieval(CommCareApplication.instance());
}

public AuthInfo.TokenAuth getConnectToken() {
Expand Down

This file was deleted.

Loading