[android] Fixed double initilization of libnotify crash

This commit is contained in:
Александр Зацепин 2018-10-02 14:26:27 +03:00 committed by Daria Volvenkova
parent 82a14d52cd
commit 28ad43855a

View file

@ -43,6 +43,7 @@ public class ExternalLibrariesMediator
private final Application mApplication;
@NonNull
private volatile EventLogger mEventLogger;
private boolean mEventLoggerInitialized;
@Nullable
private AdvertisingInfo mAdvertisingInfo;
@ -67,14 +68,15 @@ public class ExternalLibrariesMediator
private void initSensitiveEventLogger()
{
if (com.mapswithme.util.concurrency.UiThread.isUiThread())
{
mEventLogger = new EventLoggerAggregator(mApplication);
mEventLogger.initialize();
return;
}
if (!com.mapswithme.util.concurrency.UiThread.isUiThread())
throw new IllegalStateException("Must be call from Ui thread");
throw new IllegalStateException("Must be call from Ui thread");
if (mEventLoggerInitialized)
return;
mEventLogger = new EventLoggerAggregator(mApplication);
mEventLogger.initialize();
mEventLoggerInitialized = true;
}
private void initAppsFlyer()
@ -185,6 +187,7 @@ public class ExternalLibrariesMediator
return mApplication;
}
@UiThread
public void initSensitiveData()
{
initSensitiveEventLogger();