mirror of
https://github.com/oxen-io/session-android.git
synced 2025-05-02 19:01:03 +00:00
Quick fix crash
This commit is contained in:
parent
062f22071e
commit
550d8b61c7
@ -155,12 +155,11 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
broadcaster = new Broadcaster(this);
|
broadcaster = new Broadcaster(this);
|
||||||
threadNotificationHandler = new Handler(Looper.getMainLooper());
|
threadNotificationHandler = new Handler(Looper.getMainLooper());
|
||||||
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
||||||
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
|
||||||
MessagingModuleConfiguration.Companion.configure(this,
|
MessagingModuleConfiguration.Companion.configure(this,
|
||||||
DatabaseFactory.getStorage(this),
|
DatabaseFactory.getStorage(this),
|
||||||
DatabaseFactory.getAttachmentProvider(this));
|
DatabaseFactory.getAttachmentProvider(this));
|
||||||
SnodeModule.Companion.configure(apiDB, broadcaster);
|
SnodeModule.Companion.configure(apiDB, broadcaster);
|
||||||
resubmitProfilePictureIfNeeded();
|
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
||||||
if (userPublicKey != null) {
|
if (userPublicKey != null) {
|
||||||
registerForFCMIfNeeded(false);
|
registerForFCMIfNeeded(false);
|
||||||
}
|
}
|
||||||
@ -175,6 +174,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
initializeJobManager();
|
initializeJobManager();
|
||||||
initializeWebRtc();
|
initializeWebRtc();
|
||||||
initializeBlobProvider();
|
initializeBlobProvider();
|
||||||
|
resubmitProfilePictureIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -327,7 +327,6 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
this.objectGraph = ObjectGraph.create(communicationModule);
|
this.objectGraph = ObjectGraph.create(communicationModule);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initializeExpiringMessageManager() {
|
private void initializeExpiringMessageManager() {
|
||||||
this.expiringMessageManager = new ExpiringMessageManager(this);
|
this.expiringMessageManager = new ExpiringMessageManager(this);
|
||||||
}
|
}
|
||||||
@ -349,7 +348,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initializePeriodicTasks() {
|
private void initializePeriodicTasks() {
|
||||||
BackgroundPollWorker.schedulePeriodic(this); // Loki
|
BackgroundPollWorker.schedulePeriodic(this);
|
||||||
|
|
||||||
if (BuildConfig.PLAY_STORE_DISABLED) {
|
if (BuildConfig.PLAY_STORE_DISABLED) {
|
||||||
UpdateApkRefreshListener.schedule(this);
|
UpdateApkRefreshListener.schedule(this);
|
||||||
|
@ -373,8 +373,8 @@ object OnionRequestAPI {
|
|||||||
}
|
}
|
||||||
val promise = deferred.promise
|
val promise = deferred.promise
|
||||||
promise.fail { exception ->
|
promise.fail { exception ->
|
||||||
|
if (exception is HTTP.HTTPRequestFailedException && SnodeModule.isInitialized) {
|
||||||
val path = paths.firstOrNull { it.contains(guardSnode) }
|
val path = paths.firstOrNull { it.contains(guardSnode) }
|
||||||
if (exception is HTTP.HTTPRequestFailedException) {
|
|
||||||
fun handleUnspecificError() {
|
fun handleUnspecificError() {
|
||||||
if (path == null) { return }
|
if (path == null) { return }
|
||||||
var pathFailureCount = OnionRequestAPI.pathFailureCount[path] ?: 0
|
var pathFailureCount = OnionRequestAPI.pathFailureCount[path] ?: 0
|
||||||
|
@ -8,8 +8,10 @@ class SnodeModule(val storage: LokiAPIDatabaseProtocol, val broadcaster: Broadca
|
|||||||
companion object {
|
companion object {
|
||||||
lateinit var shared: SnodeModule
|
lateinit var shared: SnodeModule
|
||||||
|
|
||||||
|
val isInitialized: Boolean get() = Companion::shared.isInitialized
|
||||||
|
|
||||||
fun configure(storage: LokiAPIDatabaseProtocol, broadcaster: Broadcaster) {
|
fun configure(storage: LokiAPIDatabaseProtocol, broadcaster: Broadcaster) {
|
||||||
if (Companion::shared.isInitialized) { return }
|
if (isInitialized) { return }
|
||||||
shared = SnodeModule(storage, broadcaster)
|
shared = SnodeModule(storage, broadcaster)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user