Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3348764
D5237.id17414.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5237.id17414.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 4:01 PM (19 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2571461
Default Alt Text
D5237.id17414.diff (1 KB)
Attached To
Mode
D5237: Use GlobalDbSingleton API on Android to update database in reponse to notifs in CommNotificationsHandler.
Attached
Detach File
Event Timeline
Log In to Comment