Improve performance

This commit is contained in:
Niels Andriesse 2019-09-19 15:00:52 +10:00
parent 3a257d745b
commit c1c374407f
2 changed files with 11 additions and 0 deletions

View File

@ -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"

View File

@ -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) {