[android] Added EventLogger interface injection to Statistics class, removed deprecated calls from Activity delegate, replaced by event logger calls

This commit is contained in:
Dmitry Donskoy 2018-09-24 18:31:00 +03:00 committed by Aleksandr Zatsepin
parent 8e66aa3365
commit eb1e05e83a
2 changed files with 12 additions and 2 deletions

View file

@ -72,6 +72,9 @@ public class MwmApplication extends Application
@SuppressWarnings("NullableProblems")
@NonNull
private ExternalLibrariesMediator mMediator;
@SuppressWarnings("NullableProblems")
@NonNull
private Statistics mStatistics;
@NonNull
public SubwayManager getSubwayManager()
@ -306,6 +309,12 @@ public class MwmApplication extends Application
return mConnectivityListener;
}
@NonNull
public Statistics getStatistics()
{
return mStatistics;
}
private native void nativeInitPlatform(String apkPath, String storagePath, String privatePath,
String tmpPath, String obbGooglePath, String flavorName,
String buildType, boolean isTablet);

View file

@ -146,7 +146,7 @@ import static com.mapswithme.util.statistics.Statistics.ParamValue.UNKNOWN;
import static com.mapswithme.util.statistics.Statistics.ParamValue.VEHICLE;
import static com.mapswithme.util.statistics.Statistics.ParamValue.VIATOR;
public enum Statistics
public final class Statistics
{
INSTANCE;
@ -492,8 +492,9 @@ public enum Statistics
// avoid their initialization if user has disabled statistics collection.
private final boolean mEnabled;
Statistics()
public Statistics(@NonNull ExternalLibrariesMediator mediator)
{
mMediator = mediator;
mEnabled = SharedPropertiesUtils.isStatisticsEnabled();
final Context context = MwmApplication.get();
// At the moment we need special handling for Alohalytics to enable/disable logging of events in core C++ code.