From c1c374407ff869fafc24f9a1c7bdecb87580df76 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Thu, 19 Sep 2019 15:00:52 +1000 Subject: [PATCH] Improve performance --- build.gradle | 1 + src/org/thoughtcrime/securesms/ApplicationContext.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 6f82a9cd6c..2779e4f469 100644 --- a/build.gradle +++ b/build.gradle @@ -186,6 +186,7 @@ dependencies { implementation "com.squareup.okhttp3:okhttp:3.12.1" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "nl.komponents.kovenant:kovenant:$kovenant_version" + implementation "nl.komponents.kovenant:kovenant-android:$kovenant_version" implementation "com.github.lelloman:android-identicons:$identicon_version" implementation "com.prof.rssparser:rssparser:$rss_parser_version" implementation "com.mixpanel.android:mixpanel-android:$mixpanel_version" diff --git a/src/org/thoughtcrime/securesms/ApplicationContext.java b/src/org/thoughtcrime/securesms/ApplicationContext.java index 53bd2568e8..769497a0a6 100644 --- a/src/org/thoughtcrime/securesms/ApplicationContext.java +++ b/src/org/thoughtcrime/securesms/ApplicationContext.java @@ -104,6 +104,9 @@ import kotlin.Unit; import kotlin.jvm.functions.Function1; import network.loki.messenger.BuildConfig; +import static nl.komponents.kovenant.android.KovenantAndroid.startKovenant; +import static nl.komponents.kovenant.android.KovenantAndroid.stopKovenant; + /** * Will be called once when the TextSecure process is created. * @@ -142,6 +145,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc public void onCreate() { super.onCreate(); LokiGroupChatAPI.Companion.setDebugMode(BuildConfig.DEBUG); // Loki - Set debug mode if needed + startKovenant(); Log.i(TAG, "onCreate()"); initializeSecurityProvider(); initializeLogging(); @@ -198,6 +202,12 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc if (lokiLongPoller != null) { lokiLongPoller.stopIfNeeded(); } } + @Override + public void onTerminate() { + stopKovenant(); + super.onTerminate(); + } + @Override public void injectDependencies(Object object) { if (object instanceof InjectableType) {