mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 17:27:45 +00:00
Fix ANR
This commit is contained in:
parent
ae54c641a9
commit
feb6cfdecb
@ -2,6 +2,7 @@ package org.thoughtcrime.securesms.loki
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import nl.komponents.kovenant.functional.map
|
||||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||||
import org.thoughtcrime.securesms.jobs.PushContentReceiveJob
|
import org.thoughtcrime.securesms.jobs.PushContentReceiveJob
|
||||||
import org.thoughtcrime.securesms.service.PersistentAlarmManagerListener
|
import org.thoughtcrime.securesms.service.PersistentAlarmManagerListener
|
||||||
@ -30,8 +31,10 @@ class BackgroundPollWorker : PersistentAlarmManagerListener() {
|
|||||||
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context)
|
val userHexEncodedPublicKey = TextSecurePreferences.getLocalNumber(context)
|
||||||
val lokiAPIDatabase = DatabaseFactory.getLokiAPIDatabase(context)
|
val lokiAPIDatabase = DatabaseFactory.getLokiAPIDatabase(context)
|
||||||
try {
|
try {
|
||||||
LokiAPI(userHexEncodedPublicKey, lokiAPIDatabase).getMessages().get().forEach {
|
LokiAPI(userHexEncodedPublicKey, lokiAPIDatabase).getMessages().map { messages ->
|
||||||
PushContentReceiveJob(context).processEnvelope(SignalServiceEnvelope(it))
|
messages.forEach {
|
||||||
|
PushContentReceiveJob(context).processEnvelope(SignalServiceEnvelope(it))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (exception: Throwable) {
|
} catch (exception: Throwable) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user