diff options
author | Dmitry Donskoy <donskdmitry@mail.ru> | 2018-09-24 18:31:00 +0300 |
---|---|---|
committer | Aleksandr Zatsepin <alexzatsepin@users.noreply.github.com> | 2018-09-27 15:40:37 +0300 |
commit | eafd554af589cd572f511711caa0ca3b468d4ecf (patch) | |
tree | e80eecf6dbc8a7d0b7e19bfb35b9da99f498abe0 | |
parent | 5bea56808a20daf930741f1289dcf23345460ac6 (diff) |
[android] Added EventLogger interface injection to Statistics class, removed deprecated calls from Activity delegate, replaced by event logger calls
-rw-r--r-- | android/src/com/mapswithme/maps/MwmApplication.java | 9 | ||||
-rw-r--r-- | android/src/com/mapswithme/util/statistics/Statistics.java | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/MwmApplication.java b/android/src/com/mapswithme/maps/MwmApplication.java index 1b65acb01d..b491e1628f 100644 --- a/android/src/com/mapswithme/maps/MwmApplication.java +++ b/android/src/com/mapswithme/maps/MwmApplication.java @@ -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); diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java index 98cf05bab7..8894ef1e46 100644 --- a/android/src/com/mapswithme/util/statistics/Statistics.java +++ b/android/src/com/mapswithme/util/statistics/Statistics.java @@ -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. |