Page MenuHomePhabricator

D5237.id17340.diff
No OneTemporary

D5237.id17340.diff

diff --git a/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java b/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java
--- a/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java
+++ b/native/android/app/src/main/java/app/comm/android/CommNotificationsHandler.java
@@ -5,6 +5,7 @@
import android.service.notification.StatusBarNotification;
import android.util.Log;
import app.comm.android.fbjni.CommSecureStore;
+import app.comm.android.fbjni.GlobalDBSingleton;
import app.comm.android.fbjni.MessageOperationsUtilities;
import app.comm.android.fbjni.NetworkModule;
import app.comm.android.fbjni.ThreadOperations;
@@ -99,8 +100,10 @@
File sqliteFile =
this.getApplicationContext().getDatabasePath("comm.sqlite");
if (rawMessageInfosString != null && sqliteFile.exists()) {
- MessageOperationsUtilities.storeMessageInfos(
- sqliteFile.getPath(), rawMessageInfosString);
+ GlobalDBSingleton.scheduleOrRun(() -> {
+ MessageOperationsUtilities.storeMessageInfos(
+ sqliteFile.getPath(), rawMessageInfosString);
+ });
} else if (rawMessageInfosString != null) {
Log.w("COMM", "Database not existing yet. Skipping notification");
}
@@ -115,8 +118,10 @@
this.getApplicationContext().getDatabasePath("comm.sqlite");
if (sqliteFile.exists()) {
String threadID = message.getData().get(THREAD_ID_KEY);
- ThreadOperations.updateSQLiteUnreadStatus(
- sqliteFile.getPath(), threadID, false);
+ GlobalDBSingleton.scheduleOrRun(() -> {
+ ThreadOperations.updateSQLiteUnreadStatus(
+ sqliteFile.getPath(), threadID, false);
+ });
} else {
Log.w(
"COMM",

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 7:50 PM (19 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585961
Default Alt Text
D5237.id17340.diff (1 KB)

Event Timeline