Skip to content

Commit 117074f

Browse files
committed
Simplify queryAndRestoreNotificationsAndBadgeCount method params
* Replace needsWorkerThread with false
1 parent c623b17 commit 117074f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

OneSignalSDK/onesignal/src/main/java/com/onesignal/OSNotificationRestoreWorkManager.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public Result doWork() {
7777
StringBuilder dbQuerySelection = OneSignalDbHelper.recentUninteractedWithNotificationsWhere();
7878
skipVisibleNotifications(context, dbQuerySelection);
7979

80-
queryAndRestoreNotificationsAndBadgeCount(context, dbHelper, dbQuerySelection, false);
80+
queryAndRestoreNotificationsAndBadgeCount(context, dbHelper, dbQuerySelection);
8181

8282
return Result.success();
8383
}
@@ -87,8 +87,7 @@ public Result doWork() {
8787
private static void queryAndRestoreNotificationsAndBadgeCount(
8888
Context context,
8989
OneSignalDbHelper dbHelper,
90-
StringBuilder dbQuerySelection,
91-
boolean needsWorkerThread) {
90+
StringBuilder dbQuerySelection) {
9291

9392
OneSignal.Log(OneSignal.LOG_LEVEL.INFO,
9493
"Querying DB for notifications to restore: " + dbQuerySelection.toString());
@@ -105,7 +104,7 @@ private static void queryAndRestoreNotificationsAndBadgeCount(
105104
OneSignalDbContract.NotificationTable._ID + " DESC", // sort order, new to old
106105
NotificationLimitManager.MAX_NUMBER_OF_NOTIFICATIONS_STR // limit
107106
);
108-
showNotificationsFromCursor(context, cursor, DELAY_BETWEEN_NOTIFICATION_RESTORES_MS, needsWorkerThread);
107+
showNotificationsFromCursor(context, cursor, DELAY_BETWEEN_NOTIFICATION_RESTORES_MS, false);
109108
BadgeCountUpdater.update(dbHelper, context);
110109
} catch (Throwable t) {
111110
OneSignal.Log(OneSignal.LOG_LEVEL.ERROR, "Error restoring notification records! ", t);

0 commit comments

Comments
 (0)