diff --git a/android/res/values/donottranslate.xml b/android/res/values/donottranslate.xml
index 310d287dfc..4ed8e11536 100644
--- a/android/res/values/donottranslate.xml
+++ b/android/res/values/donottranslate.xml
@@ -16,7 +16,6 @@
sans-serif
- AllowStat
MeasurementUnits
Storage
ZoomButtonsEnabled
diff --git a/android/res/xml/prefs_main.xml b/android/res/xml/prefs_main.xml
index 9962825211..177ead788d 100644
--- a/android/res/xml/prefs_main.xml
+++ b/android/res/xml/prefs_main.xml
@@ -177,13 +177,7 @@
android:defaultValue="true"
android:title="@string/crash_reports"
android:summary="@string/crash_reports_description"
- android:order="2">
-
-
+ android:order="2"/>
params = new ArrayList<>();
- params.add(new KeyValue(Statistics.EventParam.FROM, Statistics.ParamValue.NOTIFICATION));
-
- return new Intent(context, MwmActivity.class)
- .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
- .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
- .putExtra(MwmActivity.EXTRA_TASK,
- new Factory.ShowDialogTask(PassportAuthDialogFragment.class.getName(), params));
- }
+// @NonNull
+// public static Intent createAuthenticateIntent(@NonNull Context context)
+// {
+// ArrayList params = new ArrayList<>();
+// params.add(new KeyValue(Statistics.EventParam.FROM, Statistics.ParamValue.NOTIFICATION));
+//
+// return new Intent(context, MwmActivity.class)
+// .addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
+// .addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
+// .putExtra(MwmActivity.EXTRA_TASK,
+// new Factory.ShowDialogTask(PassportAuthDialogFragment.class.getName(), params));
+// }
@NonNull
public static Intent createLeaveReviewIntent(@NonNull Context context,
@@ -489,8 +483,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
{
// TODO(yunikkk) think about refactoring. It probably should be called in editor.
Editor.nativeStartEdit();
- Statistics.INSTANCE.trackEditorLaunch(false,
- String.valueOf(OsmOAuth.isAuthorized(getApplicationContext())));
if (mIsTabletLayout)
replaceFragment(EditorHostFragment.class, null, null);
else
@@ -593,8 +585,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
boolean isLaunchByDeepLink = getIntent().getBooleanExtra(EXTRA_LAUNCH_BY_DEEP_LINK, false);
initViews(isLaunchByDeepLink);
- Statistics.INSTANCE.trackConnectionState();
-
SearchEngine.INSTANCE.addListener(this);
SharingHelper.INSTANCE.initialize(this);
@@ -697,7 +687,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
public void onShowOnMapClick()
{
showSearch(mSearchController.getQuery());
- Statistics.INSTANCE.trackSearchContextAreaClick(Statistics.ParamValue.LIST);
}
@Override
@@ -712,7 +701,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
FilterActivity.startForResult(MwmActivity.this, filter, params,
FilterActivity.REQ_CODE_FILTER);
- Statistics.INSTANCE.trackSearchContextAreaClick(Statistics.EventParam.FILTER);
}
@Override
@@ -724,7 +712,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onFilterParamsChanged()
{
- FilterUtils.trackFiltersApplying(mFilterController);
runSearch();
}
}, R.string.search_in_table, mSearchController);
@@ -757,8 +744,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
mPositionChooser.findViewById(R.id.done).setOnClickListener(
v ->
{
- Statistics.INSTANCE.trackEditorLaunch(true,
- String.valueOf(OsmOAuth.isAuthorized(getApplicationContext())));
hidePositionChooser();
if (Framework.nativeIsDownloadedMapAtScreenCenter())
startActivity(new Intent(MwmActivity.this, FeatureCategoryActivity.class));
@@ -850,15 +835,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
{
openSubsScreenBtnContainer.findViewById(R.id.onboarding_btn)
.setOnClickListener(v -> onBoardingBtnClicked(tip));
- Statistics.ParameterBuilder builder = Statistics.makeGuidesSubscriptionBuilder();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.MAP_SPONSORED_BUTTON_SHOW, builder);
}
}
private void onBoardingBtnClicked(@NonNull OnboardingTip tip)
{
- Statistics.ParameterBuilder builder = Statistics.makeGuidesSubscriptionBuilder();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.MAP_SPONSORED_BUTTON_CLICK, builder);
if (mNavAnimationController == null)
return;
@@ -1292,25 +1273,25 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onSubwayLayerSelected()
{
- toggleLayer(Mode.SUBWAY, Statistics.ParamValue.MAP);
+ toggleLayer(Mode.SUBWAY);
}
@Override
public void onTrafficLayerSelected()
{
- toggleLayer(Mode.TRAFFIC, Statistics.ParamValue.MAP);
+ toggleLayer(Mode.TRAFFIC);
}
@Override
public void onIsolinesLayerSelected()
{
- toggleLayer(Mode.ISOLINES, Statistics.ParamValue.MAP);
+ toggleLayer(Mode.ISOLINES);
}
@Override
public void onGuidesLayerSelected()
{
- toggleLayer(Mode.GUIDES, Statistics.ParamValue.MAP);
+ toggleLayer(Mode.GUIDES);
}
private void onIsolinesStateChanged(@NonNull IsolinesState type)
@@ -1346,7 +1327,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
Utils.showSnackbar(this, findViewById(R.id.coordinator),
findViewById(R.id.menu_frame), R.string.guide_downloaded_title);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_GUIDEDOWNLOADTOAST_SHOWN);
}
@Override
@@ -1642,21 +1622,12 @@ public class MwmActivity extends BaseMwmFragmentActivity
return;
}
- boolean isRoutingCancelled = RoutingController.get().cancel();
- if (isRoutingCancelled)
- {
- @Framework.RouterType
- int type = RoutingController.get().getLastRouterType();
- Statistics.INSTANCE.trackRoutingFinish(true, type,
- TrafficManager.INSTANCE.isEnabled());
- }
-
if (UiUtils.isVisible(mBookmarkCategoryToolbar) && mPlacePageController.isClosed())
{
hideBookmarkCategoryToolbar();
return;
}
-
+ boolean isRoutingCancelled = RoutingController.get().cancel();
if (!closePlacePage() && !closeSidePanel() && !isRoutingCancelled
&& !closePositionChooser())
{
@@ -1853,13 +1824,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
switch (v.getId())
{
case R.id.nav_zoom_in:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ZOOM_IN);
- AlohaHelper.logClick(AlohaHelper.ZOOM_IN);
MapFragment.nativeScalePlus();
break;
case R.id.nav_zoom_out:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ZOOM_OUT);
- AlohaHelper.logClick(AlohaHelper.ZOOM_OUT);
MapFragment.nativeScaleMinus();
break;
}
@@ -1957,17 +1924,17 @@ public class MwmActivity extends BaseMwmFragmentActivity
{
mNavigationController.show(true);
mSearchController.hide();
- mMainMenu.setState(MainMenu.State.NAVIGATION, false, mIsFullscreen);
+ mMainMenu.setState(MainMenu.State.NAVIGATION, mIsFullscreen);
return;
}
if (RoutingController.get().isPlanning())
{
- mMainMenu.setState(MainMenu.State.ROUTE_PREPARE, false, mIsFullscreen);
+ mMainMenu.setState(MainMenu.State.ROUTE_PREPARE, mIsFullscreen);
return;
}
- mMainMenu.setState(MainMenu.State.MENU, false, mIsFullscreen);
+ mMainMenu.setState(MainMenu.State.MENU, mIsFullscreen);
}
@Override
@@ -2490,8 +2457,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onRoutingFinish()
{
- Statistics.INSTANCE.trackRoutingFinish(false, RoutingController.get().getLastRouterType(),
- TrafficManager.INSTANCE.isEnabled());
}
private void showLocationNotFoundDialog()
@@ -2532,7 +2497,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
UserActionsLogger.logTipClickedEvent(mTutorial, TutorialAction.GOT_IT_CLICKED);
- Statistics.INSTANCE.trackTipsClose(mTutorial.ordinal());
mTutorial = null;
}
@@ -2574,8 +2538,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
fragment.show(getSupportFragmentManager(), dialogName);
UserActionsLogger.logPromoAfterBookingShown(promo.getId());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.INAPP_SUGGESTION_SHOWN,
- Statistics.makeInAppSuggestionParamBuilder());
return true;
}
@@ -2606,15 +2568,11 @@ public class MwmActivity extends BaseMwmFragmentActivity
RoutingController.get().waitForPoiPick(pointType);
mNavigationController.resetSearchWheel();
showSearch("");
- Statistics.INSTANCE.trackRoutingTooltipEvent(pointType, true);
}
@Override
public void onRoutingStart()
{
- @Framework.RouterType
- int routerType = RoutingController.get().getLastRouterType();
- Statistics.INSTANCE.trackRoutingStart(routerType, TrafficManager.INSTANCE.isEnabled());
closeMenu(() -> RoutingController.get().start());
}
@@ -2704,11 +2662,9 @@ public class MwmActivity extends BaseMwmFragmentActivity
switch (keyCode)
{
case KeyEvent.KEYCODE_DPAD_DOWN:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ZOOM_OUT);
MapFragment.nativeScaleMinus();
return true;
case KeyEvent.KEYCODE_DPAD_UP:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ZOOM_IN);
MapFragment.nativeScalePlus();
return true;
case KeyEvent.KEYCODE_ESCAPE:
@@ -2772,10 +2728,8 @@ public class MwmActivity extends BaseMwmFragmentActivity
AuthBundleFactory.guideCatalogue());
}
- private void toggleLayer(@NonNull Mode mode, @NonNull String from)
+ private void toggleLayer(@NonNull Mode mode)
{
- boolean isEnabled = mode.isEnabled(getApplicationContext());
- Statistics.INSTANCE.trackMapLayerClick(mode, from, isEnabled);
mToggleMapLayerController.toggleMode(mode);
}
@@ -2839,9 +2793,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onClick(View v)
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.TOOLBAR_MY_POSITION);
- AlohaHelper.logClick(AlohaHelper.TOOLBAR_MY_POSITION);
-
if (!PermissionsUtils.isLocationGranted(getApplicationContext()))
{
if (PermissionsUtils.isLocationExplanationNeeded(MwmActivity.this))
@@ -2889,13 +2840,12 @@ public class MwmActivity extends BaseMwmFragmentActivity
if (getItem() == api.getSiblingMenuItem())
{
api.createClickInterceptor().onInterceptClick(getActivity());
- Statistics.INSTANCE.trackTipsEvent(Statistics.EventName.TIPS_TRICKS_CLICK, api.ordinal());
}
else
onMenuItemClickInternal();
}
- public abstract void onMenuItemClickInternal();
+ abstract void onMenuItemClickInternal();
}
public static class MenuClickDelegate extends AbstractClickMenuDelegate
@@ -2908,7 +2858,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onMenuItemClickInternal()
{
- Statistics.INSTANCE.trackToolbarClick(getItem());
getActivity().closePlacePage();
getActivity().closeSidePanel();
MenuController controller = getActivity().getMainMenuController();
@@ -2929,30 +2878,12 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onMenuItemClickInternal()
{
- Statistics.INSTANCE.trackToolbarClick(getItem());
RoutingController.get().cancel();
getActivity().closeMenu(() -> getActivity().showSearch(getActivity().mSearchController.getQuery()));
}
}
- public abstract static class StatisticClickMenuDelegate extends AbstractClickMenuDelegate
- {
- StatisticClickMenuDelegate(@NonNull MwmActivity activity, @NonNull MainMenu.Item item)
- {
- super(activity, item);
- }
-
- @Override
- public void onMenuItemClickInternal()
- {
- Statistics.INSTANCE.trackToolbarMenu(getItem());
- onPostStatisticMenuItemClick();
- }
-
- abstract void onPostStatisticMenuItemClick();
- }
-
- public static class BookmarksDelegate extends StatisticClickMenuDelegate
+ public static class BookmarksDelegate extends AbstractClickMenuDelegate
{
public BookmarksDelegate(@NonNull MwmActivity activity, @NonNull MainMenu.Item item)
{
@@ -2960,13 +2891,13 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
@Override
- void onPostStatisticMenuItemClick()
+ void onMenuItemClickInternal()
{
getActivity().closeMenu(getActivity()::showBookmarks);
}
}
- public static class DiscoveryDelegate extends StatisticClickMenuDelegate
+ public static class DiscoveryDelegate extends AbstractClickMenuDelegate
{
public DiscoveryDelegate(@NonNull MwmActivity activity, @NonNull MainMenu.Item item)
{
@@ -2974,13 +2905,13 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
@Override
- void onPostStatisticMenuItemClick()
+ void onMenuItemClickInternal()
{
getActivity().showDiscovery();
}
}
- public static class PointToPointDelegate extends StatisticClickMenuDelegate
+ public static class PointToPointDelegate extends AbstractClickMenuDelegate
{
public PointToPointDelegate(@NonNull MwmActivity activity, @NonNull MainMenu.Item item)
{
@@ -2988,7 +2919,7 @@ public class MwmActivity extends BaseMwmFragmentActivity
}
@Override
- void onPostStatisticMenuItemClick()
+ void onMenuItemClickInternal()
{
getActivity().startLocationToPoint(null, false);
}
@@ -3034,7 +2965,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onAddPlaceOptionSelected()
{
- Statistics.INSTANCE.trackToolbarMenu(MainMenu.Item.ADD_PLACE);
closePlacePage();
closeMenu(() -> showPositionChooser(false, false));
}
@@ -3042,7 +2972,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onSearchGuidesOptionSelected()
{
- Statistics.INSTANCE.trackToolbarMenu(MainMenu.Item.DOWNLOAD_GUIDES);
int requestCode = BookmarkCategoriesActivity.REQ_CODE_DOWNLOAD_BOOKMARK_CATEGORY;
String catalogUrl = BookmarkManager.INSTANCE.getCatalogFrontendUrl(UTM.UTM_TOOLBAR_BUTTON);
closeMenu(() -> BookmarksCatalogActivity.startForResult(getActivity(), requestCode,
@@ -3052,7 +2981,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onDownloadMapsOptionSelected()
{
- Statistics.INSTANCE.trackToolbarMenu(MainMenu.Item.DOWNLOAD_MAPS);
RoutingController.get().cancel();
closeMenu(() -> showDownloader(false));
}
@@ -3060,7 +2988,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onSettingsOptionSelected()
{
- Statistics.INSTANCE.trackToolbarMenu(MainMenu.Item.SETTINGS);
Intent intent = new Intent(getActivity(), SettingsActivity.class);
closeMenu(() -> getActivity().startActivity(intent));
}
@@ -3068,32 +2995,31 @@ public class MwmActivity extends BaseMwmFragmentActivity
@Override
public void onShareLocationOptionSelected()
{
- Statistics.INSTANCE.trackToolbarMenu(MainMenu.Item.SHARE_MY_LOCATION);
closeMenu(MwmActivity.this::shareMyLocation);
}
@Override
public void onSubwayLayerOptionSelected()
{
- toggleLayer(Mode.SUBWAY, Statistics.ParamValue.MENU);
+ toggleLayer(Mode.SUBWAY);
}
@Override
public void onTrafficLayerOptionSelected()
{
- toggleLayer(Mode.TRAFFIC, Statistics.ParamValue.MENU);
+ toggleLayer(Mode.TRAFFIC);
}
@Override
public void onIsolinesLayerOptionSelected()
{
- toggleLayer(Mode.ISOLINES, Statistics.ParamValue.MENU);
+ toggleLayer(Mode.ISOLINES);
}
@Override
public void onGuidesLayerOptionSelected()
{
- toggleLayer(Mode.GUIDES, Statistics.ParamValue.MENU);
+ toggleLayer(Mode.GUIDES);
}
}
}
diff --git a/android/src/com/mapswithme/maps/MwmApplication.java b/android/src/com/mapswithme/maps/MwmApplication.java
index 30d038c95f..efc56bb1ec 100644
--- a/android/src/com/mapswithme/maps/MwmApplication.java
+++ b/android/src/com/mapswithme/maps/MwmApplication.java
@@ -45,7 +45,6 @@ import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.HashMap;
import java.util.List;
@@ -75,8 +74,6 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
private Handler mMainLoopHandler;
private final Object mMainQueueToken = new Object();
- @NonNull
- private final AppBackgroundTracker.OnVisibleAppLaunchListener mVisibleAppLaunchListener = new VisibleAppLaunchListener();
@SuppressWarnings("NullableProblems")
@NonNull
private ConnectivityListener mConnectivityListener;
@@ -153,15 +150,12 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
getLogger().d(TAG, "Application is created");
mMainLoopHandler = new Handler(getMainLooper());
mMediator = new ExternalLibrariesMediator(this);
- Statistics.INSTANCE.initialize(this);
ConnectionState.INSTANCE.initialize(this);
CrashlyticsUtils.INSTANCE.initialize(this);
- Statistics.INSTANCE.setMediator(mMediator);
-
+
initNotificationChannels();
mBackgroundTracker = new AppBackgroundTracker(this);
- mBackgroundTracker.addListener(mVisibleAppLaunchListener);
mSubwayManager = new SubwayManager(this);
mIsolinesManager = new IsolinesManager(this);
mGuidesManager = new GuidesManager(this);
@@ -382,15 +376,6 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
return mGuidesManager;
}
- private class VisibleAppLaunchListener implements AppBackgroundTracker.OnVisibleAppLaunchListener
- {
- @Override
- public void onVisibleAppLaunch()
- {
- Statistics.INSTANCE.trackColdStartupInfo(MwmApplication.this);
- }
- }
-
private class StorageCallbackImpl implements MapManager.StorageCallback
{
@Override
@@ -403,7 +388,6 @@ public class MwmApplication extends Application implements AppBackgroundTracker.
if (MapManager.nativeIsAutoretryFailed())
{
notifier.notifyDownloadFailed(item.countryId, MapManager.nativeGetName(item.countryId));
- MapManager.sendErrorStat(Statistics.EventName.DOWNLOADER_ERROR, MapManager.nativeGetError(item.countryId));
}
return;
diff --git a/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java b/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java
index f1357ac87f..7497f95445 100644
--- a/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java
+++ b/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java
@@ -27,8 +27,6 @@ import com.mapswithme.util.Counters;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
public class RateStoreDialogFragment extends BaseMwmDialogFragment implements View.OnClickListener
{
@@ -49,7 +47,6 @@ public class RateStoreDialogFragment extends BaseMwmDialogFragment implements Vi
@Override
public void onClick(DialogInterface dialog, int which)
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.RATE_DIALOG_LATER);
}
});
@@ -60,7 +57,6 @@ public class RateStoreDialogFragment extends BaseMwmDialogFragment implements Vi
@Override
public void onRatingChanged(RatingBar ratingBar, float rating, boolean fromUser)
{
- Statistics.INSTANCE.trackRatingDialog(rating);
mRating = rating;
if (rating >= BuildConfig.RATING_THRESHOLD)
{
@@ -100,7 +96,6 @@ public class RateStoreDialogFragment extends BaseMwmDialogFragment implements Vi
public void onCancel(DialogInterface dialog)
{
super.onCancel(dialog);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.RATE_DIALOG_LATER);
}
@Override
@@ -131,7 +126,6 @@ public class RateStoreDialogFragment extends BaseMwmDialogFragment implements Vi
startActivity(intent);
} catch (android.content.ActivityNotFoundException e)
{
- AlohaHelper.logException(e);
}
break;
}
diff --git a/android/src/com/mapswithme/maps/auth/Authorizer.java b/android/src/com/mapswithme/maps/auth/Authorizer.java
index 6d6e6c1828..e2bdf8bfe5 100644
--- a/android/src/com/mapswithme/maps/auth/Authorizer.java
+++ b/android/src/com/mapswithme/maps/auth/Authorizer.java
@@ -11,7 +11,6 @@ import android.os.Bundle;
import android.text.TextUtils;
import com.mapswithme.maps.Framework;
-import com.mapswithme.util.statistics.Statistics;
/**
* An authorizer is responsible for an authorization for the Mapsme server,
@@ -96,13 +95,11 @@ public class Authorizer implements AuthorizationListener
boolean isCancel = data.getBooleanExtra(Constants.EXTRA_IS_CANCEL, false);
if (isCancel)
{
- Statistics.INSTANCE.trackAuthDeclined(type);
mCallback.onSocialAuthenticationCancel(type);
return;
}
String error = data.getStringExtra(Constants.EXTRA_AUTH_ERROR);
- Statistics.INSTANCE.trackAuthError(type, error);
mCallback.onSocialAuthenticationError(type, error);
return;
}
@@ -125,7 +122,6 @@ public class Authorizer implements AuthorizationListener
Framework.nativeAuthenticateUser(socialToken, type, privacyAccepted, termsOfUseAccepted,
promoAccepted, this);
mTokenType = type;
- Statistics.INSTANCE.trackAuthExternalRequestSuccess(type);
}
}
@@ -135,8 +131,6 @@ public class Authorizer implements AuthorizationListener
mIsAuthorizationInProgress = false;
if (mCallback != null)
mCallback.onAuthorizationFinish(success);
-
- Statistics.INSTANCE.trackAuthRequestSuccess(mTokenType);
}
public boolean isAuthorizationInProgress()
diff --git a/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java b/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java
index ee646084a2..77470c9d42 100644
--- a/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java
+++ b/android/src/com/mapswithme/maps/auth/PassportAuthDialogFragment.java
@@ -9,7 +9,6 @@ import androidx.annotation.Nullable;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.background.Notifier;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
-import com.mapswithme.util.statistics.Statistics;
public class PassportAuthDialogFragment extends BaseMwmDialogFragment
implements TargetFragmentCallback
@@ -82,14 +81,12 @@ public class PassportAuthDialogFragment extends BaseMwmDialogFragment
@Override
public void onSocialAuthenticationCancel(@Framework.AuthTokenType int type)
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_AUTH_DECLINED);
}
@Override
public void onSocialAuthenticationError(@Framework.AuthTokenType int type,
@Nullable String error)
{
- Statistics.INSTANCE.trackUGCAuthFailed(type, error);
}
}
}
diff --git a/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java b/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java
index 5e9a5edf33..1fbeeaa65f 100644
--- a/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java
+++ b/android/src/com/mapswithme/maps/auth/SocialAuthDialogFragment.java
@@ -26,7 +26,6 @@ import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Arrays;
import java.util.List;
@@ -49,7 +48,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment
private final View.OnClickListener mPhoneClickListener = (View v) ->
{
PhoneAuthActivity.startForResult(this);
- trackStatsIfArgsExist(Statistics.EventName.AUTH_START);
};
@NonNull
private final View.OnClickListener mGoogleClickListener = new View.OnClickListener()
@@ -59,7 +57,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment
{
Intent intent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(intent, Constants.REQ_CODE_GOOGLE_SIGN_IN);
- trackStatsIfArgsExist(Statistics.EventName.AUTH_START);
}
};
@SuppressWarnings("NullableProblems")
@@ -95,16 +92,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment
mGoogleSignInClient = GoogleSignIn.getClient(requireActivity(), gso);
}
- private void trackStatsIfArgsExist(@NonNull String action)
- {
- Bundle args = getArguments();
- if (args == null)
- return;
-
- Statistics.INSTANCE.trackAuthDialogAction(action,
- Objects.requireNonNull(args.getString(Statistics.EventParam.FROM)));
- }
-
private void setTargetCallback()
{
try
@@ -147,8 +134,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment
Framework.nativeGetTermsOfUseLink());
setButtonAvailability(view, false, R.id.google_button, R.id.phone_button);
-
- trackStatsIfArgsExist(Statistics.EventName.AUTH_SHOWN);
return view;
}
@@ -172,7 +157,6 @@ public class SocialAuthDialogFragment extends BaseMwmDialogFragment
public void onResume()
{
super.onResume();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_AUTH_SHOWN);
}
private void sendResult(int resultCode, @Nullable String socialToken,
diff --git a/android/src/com/mapswithme/maps/background/Notifier.java b/android/src/com/mapswithme/maps/background/Notifier.java
index c35f108001..12dd813b2a 100644
--- a/android/src/com/mapswithme/maps/background/Notifier.java
+++ b/android/src/com/mapswithme/maps/background/Notifier.java
@@ -15,7 +15,6 @@ import com.mapswithme.maps.MwmActivity;
import com.mapswithme.maps.R;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -55,39 +54,31 @@ public final class Notifier
String channel = NotificationChannelFactory.createProvider(mContext).getDownloadingChannel();
placeNotification(title, content, pi, ID_DOWNLOAD_FAILED, channel);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOAD_COUNTRY_NOTIFICATION_SHOWN);
}
- void notifyAuthentication()
- {
- Intent authIntent = MwmActivity.createAuthenticateIntent(mContext);
- authIntent.putExtra(EXTRA_CANCEL_NOTIFICATION, Notifier.ID_IS_NOT_AUTHENTICATED);
- authIntent.putExtra(EXTRA_NOTIFICATION_CLICKED,
- Statistics.EventName.UGC_NOT_AUTH_NOTIFICATION_CLICKED);
-
- PendingIntent pi = PendingIntent.getActivity(mContext, 0, authIntent,
- PendingIntent.FLAG_UPDATE_CURRENT);
-
- String channel = NotificationChannelFactory.createProvider(mContext).getUGCChannel();
- NotificationCompat.Builder builder =
- getBuilder(mContext.getString(R.string.notification_unsent_reviews_title),
- mContext.getString(R.string.notification_unsent_reviews_message),
- pi, channel);
-
- builder.addAction(0, mContext.getString(R.string.authorization_button_sign_in), pi);
-
- getNotificationManager().notify(ID_IS_NOT_AUTHENTICATED, builder.build());
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_NOT_AUTH_NOTIFICATION_SHOWN);
- }
+// void notifyAuthentication()
+// {
+// Intent authIntent = MwmActivity.createAuthenticateIntent(mContext);
+// authIntent.putExtra(EXTRA_CANCEL_NOTIFICATION, Notifier.ID_IS_NOT_AUTHENTICATED);
+// PendingIntent pi = PendingIntent.getActivity(mContext, 0, authIntent,
+// PendingIntent.FLAG_UPDATE_CURRENT);
+//
+// String channel = NotificationChannelFactory.createProvider(mContext).getUGCChannel();
+// NotificationCompat.Builder builder =
+// getBuilder(mContext.getString(R.string.notification_unsent_reviews_title),
+// mContext.getString(R.string.notification_unsent_reviews_message),
+// pi, channel);
+//
+// builder.addAction(0, mContext.getString(R.string.authorization_button_sign_in), pi);
+//
+// getNotificationManager().notify(ID_IS_NOT_AUTHENTICATED, builder.build());
+//
+// }
void notifyLeaveReview(@NonNull NotificationCandidate.UgcReview source)
{
Intent reviewIntent = MwmActivity.createLeaveReviewIntent(mContext, source);
reviewIntent.putExtra(EXTRA_CANCEL_NOTIFICATION, Notifier.ID_LEAVE_REVIEW);
- reviewIntent.putExtra(EXTRA_NOTIFICATION_CLICKED,
- Statistics.EventName.UGC_REVIEW_NOTIFICATION_CLICKED);
-
PendingIntent pi =
PendingIntent.getActivity(mContext, 0, reviewIntent, PendingIntent.FLAG_UPDATE_CURRENT);
@@ -107,7 +98,6 @@ public final class Notifier
getNotificationManager().notify(ID_LEAVE_REVIEW, builder.build());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_REVIEW_NOTIFICATION_SHOWN);
}
public void cancelNotification(@NotificationId int id)
@@ -133,7 +123,6 @@ public final class Notifier
if (intent.hasExtra(Notifier.EXTRA_NOTIFICATION_CLICKED))
{
String eventName = intent.getStringExtra(Notifier.EXTRA_NOTIFICATION_CLICKED);
- Statistics.INSTANCE.trackEvent(eventName);
}
}
diff --git a/android/src/com/mapswithme/maps/base/BaseActivityDelegate.java b/android/src/com/mapswithme/maps/base/BaseActivityDelegate.java
index 772b77a6f2..9842596898 100644
--- a/android/src/com/mapswithme/maps/base/BaseActivityDelegate.java
+++ b/android/src/com/mapswithme/maps/base/BaseActivityDelegate.java
@@ -13,7 +13,6 @@ import com.mapswithme.util.ViewServer;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
public class BaseActivityDelegate
{
@@ -67,13 +66,11 @@ public class BaseActivityDelegate
public void onStart()
{
logLifecycleMethod("onStart()");
- Statistics.INSTANCE.startActivity(mActivity.get());
}
public void onStop()
{
logLifecycleMethod("onStop()");
- Statistics.INSTANCE.stopActivity(mActivity.get());
}
public void onResume()
diff --git a/android/src/com/mapswithme/maps/bookmarks/AuthBundleFactory.java b/android/src/com/mapswithme/maps/bookmarks/AuthBundleFactory.java
index 5068d07521..6982fd05d0 100644
--- a/android/src/com/mapswithme/maps/bookmarks/AuthBundleFactory.java
+++ b/android/src/com/mapswithme/maps/bookmarks/AuthBundleFactory.java
@@ -3,7 +3,6 @@ package com.mapswithme.maps.bookmarks;
import android.os.Bundle;
import androidx.annotation.NonNull;
-import com.mapswithme.util.statistics.Statistics;
public class AuthBundleFactory
{
diff --git a/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java b/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java
index 581c3c1327..85fbbb722a 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BaseBookmarkCategoriesFragment.java
@@ -31,8 +31,6 @@ import com.mapswithme.maps.widget.recycler.ItemDecoratorFactory;
import com.mapswithme.util.BottomSheetHelper;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.sharing.SharingHelper;
-import com.mapswithme.util.statistics.Analytics;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -165,7 +163,6 @@ public abstract class BaseBookmarkCategoriesFragment extends BaseMwmRecyclerFrag
processor
.mInternalProcessor
.process(this, getSelectedCategory());
- Statistics.INSTANCE.trackBookmarkListSettingsClick(processor.getAnalytics());
return true;
}
@@ -350,12 +347,12 @@ public abstract class BaseBookmarkCategoriesFragment extends BaseMwmRecyclerFrag
protected enum MenuItemClickProcessorWrapper
{
- SET_SHARE(R.id.share, shareAction(), new Analytics(Statistics.ParamValue.SEND_AS_FILE)),
- SET_EDIT(R.id.edit, editAction(), new Analytics(Statistics.ParamValue.EDIT)),
- SHOW_ON_MAP(R.id.show_on_map, showAction(), new Analytics(Statistics.ParamValue.MAKE_INVISIBLE_ON_MAP)),
-// SHARING_OPTIONS(R.id.sharing_options, showSharingOptions(), new Analytics(Statistics.ParamValue.SHARING_OPTIONS)),
- LIST_SETTINGS(R.id.settings, showListSettings(), new Analytics(Statistics.ParamValue.LIST_SETTINGS)),
- DELETE_LIST(R.id.delete, deleteAction(), new Analytics(Statistics.ParamValue.DELETE_GROUP));
+ SET_SHARE(R.id.share, shareAction()),
+ SET_EDIT(R.id.edit, editAction()),
+ SHOW_ON_MAP(R.id.show_on_map, showAction()),
+// SHARING_OPTIONS(R.id.sharing_options, showSharingOptions()),
+ LIST_SETTINGS(R.id.settings, showListSettings()),
+ DELETE_LIST(R.id.delete, deleteAction());
@NonNull
private static MenuClickProcessorBase showSharingOptions()
@@ -397,15 +394,11 @@ public abstract class BaseBookmarkCategoriesFragment extends BaseMwmRecyclerFrag
private final int mId;
@NonNull
private MenuClickProcessorBase mInternalProcessor;
- @NonNull
- private final Analytics mAnalytics;
- MenuItemClickProcessorWrapper(@IdRes int id, @NonNull MenuClickProcessorBase processorBase,
- @NonNull Analytics analytics)
+ MenuItemClickProcessorWrapper(@IdRes int id, @NonNull MenuClickProcessorBase processorBase)
{
mId = id;
mInternalProcessor = processorBase;
- mAnalytics = analytics;
}
@NonNull
@@ -420,12 +413,6 @@ public abstract class BaseBookmarkCategoriesFragment extends BaseMwmRecyclerFrag
}
throw new IllegalArgumentException("Enum value for res id = " + resId + " not found");
}
-
- @NonNull
- public Analytics getAnalytics()
- {
- return mAnalytics;
- }
}
protected static abstract class MenuClickProcessorBase
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkBackupController.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkBackupController.java
index 683bea1597..8625e8f69a 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarkBackupController.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkBackupController.java
@@ -23,7 +23,6 @@ import com.mapswithme.util.SharedPropertiesUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Date;
@@ -38,7 +37,6 @@ import static com.mapswithme.maps.bookmarks.data.BookmarkManager.CLOUD_NO_BACKUP
import static com.mapswithme.maps.bookmarks.data.BookmarkManager.CLOUD_RESTORE;
import static com.mapswithme.maps.bookmarks.data.BookmarkManager.CLOUD_SUCCESS;
import static com.mapswithme.maps.bookmarks.data.BookmarkManager.CLOUD_USER_INTERRUPTED;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_CANCEL;
public class BookmarkBackupController implements Authorizer.Callback,
BookmarkManager.BookmarksCloudListener
@@ -60,31 +58,19 @@ public class BookmarkBackupController implements Authorizer.Callback,
public void onClick(View v)
{
mAuthorizer.authorize(AuthBundleFactory.bookmarksBackup());
- Statistics.INSTANCE.trackBmSyncProposalApproved(false);
}
};
@NonNull
- private final View.OnClickListener mEnableClickListener = new View.OnClickListener()
- {
- @Override
- public void onClick(View v)
- {
- BookmarkManager.INSTANCE.setCloudEnabled(true);
- updateWidget();
- Statistics.INSTANCE.trackBmSyncProposalApproved(mAuthorizer.isAuthorized());
- }
+ private final View.OnClickListener mEnableClickListener = v -> {
+ BookmarkManager.INSTANCE.setCloudEnabled(true);
+ updateWidget();
};
@NonNull
- private final View.OnClickListener mRestoreClickListener = v ->
- {
- requestRestoring();
- Statistics.INSTANCE.trackBmRestoreProposalClick();
- };
+ private final View.OnClickListener mRestoreClickListener = v -> requestRestoring();
@Nullable
private ProgressDialog mRestoringProgressDialog;
@NonNull
private final DialogInterface.OnClickListener mRestoreCancelListener = (dialog, which) -> {
- Statistics.INSTANCE.trackEvent(BM_RESTORE_PROPOSAL_CANCEL);
BookmarkManager.INSTANCE.cancelRestoring();
};
@@ -158,7 +144,6 @@ public class BookmarkBackupController implements Authorizer.Callback,
mBackupView.setBackupClickListener(mSignInClickListener);
mBackupView.showBackupButton();
mBackupView.hideRestoreButton();
- Statistics.INSTANCE.trackBmSyncProposalShown(mAuthorizer.isAuthorized());
}
return;
}
@@ -192,7 +177,6 @@ public class BookmarkBackupController implements Authorizer.Callback,
mBackupView.setBackupClickListener(mEnableClickListener);
mBackupView.showBackupButton();
mBackupView.hideRestoreButton();
- Statistics.INSTANCE.trackBmSyncProposalShown(mAuthorizer.isAuthorized());
}
public void onStart()
@@ -231,13 +215,11 @@ public class BookmarkBackupController implements Authorizer.Callback,
final Notifier notifier = Notifier.from(mContext.getApplication());
notifier.cancelNotification(Notifier.ID_IS_NOT_AUTHENTICATED);
BookmarkManager.INSTANCE.setCloudEnabled(true);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_SYNC_PROPOSAL_ENABLED);
mAuthCompleteListener.onAuthCompleted();
}
else
{
Utils.showSnackbar(mContext, mBackupView.getRootView(), R.string.profile_authorization_error);
- Statistics.INSTANCE.trackBmSyncProposalError(Framework.TOKEN_MAPSME, "Unknown error");
}
updateWidget();
}
@@ -245,26 +227,22 @@ public class BookmarkBackupController implements Authorizer.Callback,
@Override
public void onSocialAuthenticationError(@Framework.AuthTokenType int type, @Nullable String error)
{
- LOGGER.w(TAG, "onSocialAuthenticationError, type: " + Statistics.getAuthProvider(type) +
- " error: " + error);
- Statistics.INSTANCE.trackBmSyncProposalError(type, error);
+ LOGGER.w(TAG, "onSocialAuthenticationError, type: " + type + " error: " + error);
}
@Override
public void onSocialAuthenticationCancel(@Framework.AuthTokenType int type)
{
- LOGGER.i(TAG, "onSocialAuthenticationCancel, type: " + Statistics.getAuthProvider(type));
- Statistics.INSTANCE.trackBmSyncProposalError(type, "Cancel");
+ LOGGER.i(TAG, "onSocialAuthenticationCancel, type: " + type);
}
@Override
public void onSynchronizationStarted(@BookmarkManager.SynchronizationType int type)
{
- LOGGER.d(TAG, "onSynchronizationStarted, type: " + Statistics.getSynchronizationType(type));
+ LOGGER.d(TAG, "onSynchronizationStarted, type: " + type);
switch (type)
{
case CLOUD_BACKUP:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_SYNC_STARTED);
break;
case CLOUD_RESTORE:
showRestoringProgressDialog();
@@ -280,9 +258,8 @@ public class BookmarkBackupController implements Authorizer.Callback,
@BookmarkManager.SynchronizationResult int result,
@NonNull String errorString)
{
- LOGGER.d(TAG, "onSynchronizationFinished, type: " + Statistics.getSynchronizationType(type)
+ LOGGER.d(TAG, "onSynchronizationFinished, type: " + type
+ ", result: " + result + ", errorString = " + errorString);
- Statistics.INSTANCE.trackBmSynchronizationFinish(type, result, errorString);
hideRestoringProgressDialog();
updateWidget();
@@ -323,7 +300,6 @@ public class BookmarkBackupController implements Authorizer.Callback,
{
LOGGER.d(TAG, "onRestoreRequested, result: " + result + ", deviceName = " + deviceName +
", backupTimestampInMs = " + backupTimestampInMs);
- Statistics.INSTANCE.trackBmRestoringRequestResult(result);
hideRestoringProgressDialog();
switch (result)
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesPagerFragment.java b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesPagerFragment.java
index 323aa89ad2..b29a2cf886 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesPagerFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarkCategoriesPagerFragment.java
@@ -21,7 +21,6 @@ import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.dialog.AlertDialogCallback;
import com.mapswithme.maps.purchase.PurchaseUtils;
import com.mapswithme.util.SharedPropertiesUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Arrays;
import java.util.Collections;
@@ -264,7 +263,6 @@ public class BookmarkCategoriesPagerFragment extends BaseMwmFragment
{
SharedPropertiesUtils.setLastVisibleBookmarkCategoriesPage(requireActivity(), position);
BookmarksPageFactory factory = mAdapter.getItemFactory(position);
- Statistics.INSTANCE.trackBookmarksTabEvent(factory.getAnalytics().getName());
}
}
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java b/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java
index 35ab33282a..8384cce5e0 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarksCatalogFragment.java
@@ -56,7 +56,6 @@ import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
@@ -442,13 +441,9 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
return;
if (type.equals(SubscriptionType.BOOKMARKS_ALL))
- BookmarksAllSubscriptionActivity.startForResult(frag,
- PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION,
- Statistics.ParamValue.WEBVIEW);
+ BookmarksAllSubscriptionActivity.startForResult(frag, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
else
- BookmarksSightsSubscriptionActivity.startForResult(frag,
- PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION,
- Statistics.ParamValue.WEBVIEW);
+ BookmarksSightsSubscriptionActivity.startForResult(frag, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
}
@Override
@@ -504,13 +499,9 @@ public class BookmarksCatalogFragment extends BaseWebViewMwmFragment
if (ConnectionState.INSTANCE.isConnected())
{
LOGGER.e(TAG, "Failed to load catalog: " + mError + ", description: " + description);
- Statistics.INSTANCE.trackDownloadCatalogError(Statistics.ParamValue.UNKNOWN);
return;
}
-
- Statistics.INSTANCE.trackDownloadCatalogError(Statistics.ParamValue.NO_INTERNET);
- Utils.showSnackbar(frag.requireContext(), frag.getViewOrThrow(),
- R.string.common_check_internet_connection_dialog_title);
+ Utils.showSnackbar(frag.requireContext(), frag.getViewOrThrow(), R.string.common_check_internet_connection_dialog_title);
}
private void retry()
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadFragmentDelegate.java b/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadFragmentDelegate.java
index 5ad0b4fac5..1210fe035d 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadFragmentDelegate.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarksDownloadFragmentDelegate.java
@@ -29,7 +29,6 @@ import com.mapswithme.maps.purchase.SubscriptionType;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Objects;
@@ -210,12 +209,12 @@ class BookmarksDownloadFragmentDelegate implements Authorizer.Callback, Bookmark
if (type.equals(SubscriptionType.BOOKMARKS_SIGHTS))
{
BookmarksSightsSubscriptionActivity.startForResult
- (mFragment, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION, Statistics.ParamValue.WEBVIEW);
+ (mFragment, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
return;
}
BookmarksAllSubscriptionActivity.startForResult
- (mFragment, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION, Statistics.ParamValue.WEBVIEW);
+ (mFragment, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
return;
}
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarksListFragment.java b/android/src/com/mapswithme/maps/bookmarks/BookmarksListFragment.java
index 2b612c37c9..71016f1bc6 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarksListFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarksListFragment.java
@@ -50,7 +50,6 @@ import com.mapswithme.util.CrashlyticsUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.sharing.ShareOption;
import com.mapswithme.util.sharing.SharingHelper;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -147,11 +146,6 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment
mCategoryItems, mCollectionItems);
adapter.setOnClickListener((v, item) -> {
Intent intent = BookmarkListActivity.getStartIntent(requireContext(), item);
-
- final boolean isCategory = BookmarkManager.INSTANCE.getCompilationType(item.getId()) ==
- BookmarkManager.CATEGORY;
- Statistics.INSTANCE.trackCollectionOrCategorySelect(item.getServerId(), item.getName(),
- isCategory);
startActivity(intent);
});
@@ -368,7 +362,6 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment
{
if (!isAdded() || !mToolbarController.hasQuery() || mLastQueryTimestamp != timestamp)
return;
- trackBookmarksSearch();
mLastQueryTimestamp = 0;
mToolbarController.showProgress(false);
updateSearchResults(bookmarkIds);
@@ -636,22 +629,14 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment
final Track track = (Track) adapter.getItem(position);
i.putExtra(MwmActivity.EXTRA_TASK,
new Factory.ShowTrackTask(track.getCategoryId(), track.getTrackId()));
- if (BookmarkManager.INSTANCE.isGuide(mCategoryDataSource.getData()))
- Statistics.INSTANCE.trackGuideTrackSelect(mCategoryDataSource.getData().getServerId());
}
private void onBookmarkClicked(int position, @NonNull Intent i,
@NonNull BookmarkListAdapter adapter)
{
- if (getBookmarkListAdapter().isSearchResults())
- trackBookmarksSearchResultSelected();
-
final BookmarkInfo bookmark = (BookmarkInfo) adapter.getItem(position);
i.putExtra(MwmActivity.EXTRA_TASK,
new Factory.ShowBookmarkTask(bookmark.getCategoryId(), bookmark.getBookmarkId()));
-
- Statistics.INSTANCE.trackGuideBookmarkSelect(mCategoryDataSource.getData().getServerId(),
- bookmark.getCategoryId());
}
public void onItemMore(int position)
@@ -855,21 +840,6 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment
BookmarksDescriptionActivity.start(requireContext(), mCategoryDataSource.getData());
}
- private static void trackBookmarkListSharingOptions()
- {
- Statistics.INSTANCE.trackBookmarkListSharingOptions();
- }
-
- private static void trackBookmarksSearch()
- {
- Statistics.INSTANCE.trackBookmarksListSearch();
- }
-
- private static void trackBookmarksSearchResultSelected()
- {
- Statistics.INSTANCE.trackBookmarksListSearchResultSelected();
- }
-
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
diff --git a/android/src/com/mapswithme/maps/bookmarks/BookmarksPageFactory.java b/android/src/com/mapswithme/maps/bookmarks/BookmarksPageFactory.java
index 2d05369f3e..4f81a21879 100644
--- a/android/src/com/mapswithme/maps/bookmarks/BookmarksPageFactory.java
+++ b/android/src/com/mapswithme/maps/bookmarks/BookmarksPageFactory.java
@@ -6,13 +6,10 @@ import androidx.fragment.app.Fragment;
import android.text.TextUtils;
import com.mapswithme.maps.R;
-import com.mapswithme.util.statistics.Analytics;
-import com.mapswithme.util.statistics.Statistics;
public enum BookmarksPageFactory
{
- PRIVATE(new Analytics(Statistics.ParamValue.MY),
- true)
+ PRIVATE(true)
{
@NonNull
@Override
@@ -28,8 +25,7 @@ public enum BookmarksPageFactory
}
},
- DOWNLOADED(new Analytics(Statistics.ParamValue.DOWNLOADED),
- new BookmarkCategoriesPageResProvider.Catalog(),
+ DOWNLOADED(new BookmarkCategoriesPageResProvider.Catalog(),
false)
{
@NonNull
@@ -48,22 +44,18 @@ public enum BookmarksPageFactory
@NonNull
private final BookmarkCategoriesPageResProvider mResProvider;
- @NonNull
- private final Analytics mAnalytics;
private final boolean mAdapterFooterAvailable;
- BookmarksPageFactory(@NonNull Analytics analytics,
- @NonNull BookmarkCategoriesPageResProvider provider,
+ BookmarksPageFactory(@NonNull BookmarkCategoriesPageResProvider provider,
boolean hasAdapterFooter)
{
- mAnalytics = analytics;
mResProvider = provider;
mAdapterFooterAvailable = hasAdapterFooter;
}
- BookmarksPageFactory(Analytics analytics, boolean hasAdapterFooter)
+ BookmarksPageFactory(boolean hasAdapterFooter)
{
- this(analytics, new BookmarkCategoriesPageResProvider.Default(), hasAdapterFooter);
+ this(new BookmarkCategoriesPageResProvider.Default(), hasAdapterFooter);
}
@NonNull
@@ -72,12 +64,6 @@ public enum BookmarksPageFactory
return mResProvider;
}
- @NonNull
- public Analytics getAnalytics()
- {
- return mAnalytics;
- }
-
public static BookmarksPageFactory get(String value)
{
for (BookmarksPageFactory each : values())
@@ -87,10 +73,8 @@ public enum BookmarksPageFactory
return each;
}
}
- throw new IllegalArgumentException(new StringBuilder()
- .append("not found enum instance for value = ")
- .append(value)
- .toString());
+ throw new IllegalArgumentException("not found enum instance for value = " +
+ value);
}
@NonNull
diff --git a/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java b/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java
index 834f878df0..86843ccb69 100644
--- a/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/CachedBookmarkCategoriesFragment.java
@@ -19,7 +19,6 @@ import com.mapswithme.maps.bookmarks.data.CatalogTagsGroup;
import com.mapswithme.util.SharedPropertiesUtils;
import com.mapswithme.util.UTM;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -81,14 +80,6 @@ public class CachedBookmarkCategoriesFragment extends BaseBookmarkCategoriesFrag
return BookmarkCategory.Type.DOWNLOADED;
}
- @Override
- public void onItemClick(@NonNull View v, @NonNull BookmarkCategory category)
- {
- if (BookmarkManager.INSTANCE.isGuide(category))
- Statistics.INSTANCE.trackGuideOpen(category.getServerId());
- super.onItemClick(v, category);
- }
-
@Override
public void onFooterClick()
{
@@ -124,8 +115,6 @@ public class CachedBookmarkCategoriesFragment extends BaseBookmarkCategoriesFrag
UiUtils.showIf(isEmptyAdapter, mEmptyViewContainer);
mPayloadContainer.setVisibility(isEmptyAdapter ? View.GONE : View.VISIBLE);
mProgressContainer.setVisibility(View.GONE);
- if (!isEmptyAdapter)
- Statistics.INSTANCE.trackGuidesShown(BookmarkManager.INSTANCE.getGuidesIds());
}
}
@@ -141,7 +130,6 @@ public class CachedBookmarkCategoriesFragment extends BaseBookmarkCategoriesFrag
UTM.UTM_BOOKMARKS_PAGE_CATALOG_BUTTON);
BookmarksCatalogActivity.startForResult(this, BaseBookmarkCategoriesFragment.REQ_CODE_CATALOG,
catalogUrl);
- Statistics.INSTANCE.trackOpenCatalogScreen();
}
@Override
@@ -218,7 +206,6 @@ public class CachedBookmarkCategoriesFragment extends BaseBookmarkCategoriesFrag
UiUtils.show(mPayloadContainer);
UiUtils.hide(mProgressContainer, mEmptyViewContainer);
getAdapter().notifyDataSetChanged();
- Statistics.INSTANCE.trackGuidesShown(BookmarkManager.INSTANCE.getGuidesIds());
}
else
{
diff --git a/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarkCategoryFragment.java b/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarkCategoryFragment.java
index dd8304fc4e..b7392f7b56 100644
--- a/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarkCategoryFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarkCategoryFragment.java
@@ -16,7 +16,6 @@ import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.maps.bookmarks.data.BookmarkCategory;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.dialog.EditTextDialogFragment;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -112,7 +111,6 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmDialogFragment
mListener.onCategoryChanged(newCategory);
}
dismiss();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_GROUP_CREATED);
}
@Override
@@ -125,7 +123,6 @@ public class ChooseBookmarkCategoryFragment extends BaseMwmDialogFragment
mListener.onCategoryChanged(category);
}
dismiss();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_GROUP_CHANGED);
}
@Override
diff --git a/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarksSortingTypeFragment.java b/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarksSortingTypeFragment.java
index 70417c4057..6575a6dcd3 100644
--- a/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarksSortingTypeFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/ChooseBookmarksSortingTypeFragment.java
@@ -16,7 +16,6 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
public class ChooseBookmarksSortingTypeFragment extends BaseMwmDialogFragment
implements RadioGroup.OnCheckedChangeListener
@@ -130,7 +129,6 @@ public class ChooseBookmarksSortingTypeFragment extends BaseMwmDialogFragment
{
if (mListener != null)
mListener.onResetSorting();
- trackBookmarksListResetSort();
dismiss();
}
@@ -138,7 +136,6 @@ public class ChooseBookmarksSortingTypeFragment extends BaseMwmDialogFragment
{
if (mListener != null)
mListener.onSort(sortingType);
- trackBookmarksListSort(sortingType);
dismiss();
}
@@ -161,14 +158,4 @@ public class ChooseBookmarksSortingTypeFragment extends BaseMwmDialogFragment
break;
}
}
-
- private static void trackBookmarksListSort(@BookmarkManager.SortingType int sortingType)
- {
- Statistics.INSTANCE.trackBookmarksListSort(sortingType);
- }
-
- private static void trackBookmarksListResetSort()
- {
- Statistics.INSTANCE.trackBookmarksListResetSort();
- }
}
diff --git a/android/src/com/mapswithme/maps/bookmarks/Holders.java b/android/src/com/mapswithme/maps/bookmarks/Holders.java
index 7d4d0b05d5..25b46afdad 100644
--- a/android/src/com/mapswithme/maps/bookmarks/Holders.java
+++ b/android/src/com/mapswithme/maps/bookmarks/Holders.java
@@ -28,7 +28,6 @@ import com.mapswithme.maps.widget.recycler.RecyclerClickListener;
import com.mapswithme.maps.widget.recycler.RecyclerLongClickListener;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
public class Holders
{
@@ -130,8 +129,6 @@ public class Holders
private final int mCompilationType;
@NonNull
private final String mServerId;
- @NonNull
- private final String mCompilationTypeString;
ToggleShowAllChildCategoryClickListener(@NonNull HeaderActionChildCategories action,
boolean showAll,
@@ -142,25 +139,15 @@ public class Holders
mShowAll = showAll;
mCompilationType = compilationType;
mServerId = serverId;
- mCompilationTypeString = compilationType == BookmarkManager.CATEGORY ?
- Statistics.ParamValue.CATEGORY : Statistics.ParamValue.COLLECTION;
}
@Override
public void onClick(View view)
{
if (mShowAll)
- {
mAction.onShowAll(mCompilationType);
- Statistics.INSTANCE.trackGuideVisibilityChange(Statistics.ParamValue.SHOW_ALL, mServerId,
- mCompilationTypeString);
- }
else
- {
mAction.onHideAll(mCompilationType);
- Statistics.INSTANCE.trackGuideVisibilityChange(Statistics.ParamValue.HIDE_ALL, mServerId,
- mCompilationTypeString);
- }
}
}
diff --git a/android/src/com/mapswithme/maps/bookmarks/InvalidSubscriptionAlertDialogCallback.java b/android/src/com/mapswithme/maps/bookmarks/InvalidSubscriptionAlertDialogCallback.java
index 7735701b6f..fdbfb09ee3 100644
--- a/android/src/com/mapswithme/maps/bookmarks/InvalidSubscriptionAlertDialogCallback.java
+++ b/android/src/com/mapswithme/maps/bookmarks/InvalidSubscriptionAlertDialogCallback.java
@@ -8,7 +8,6 @@ import com.mapswithme.maps.purchase.BookmarksAllSubscriptionActivity;
import com.mapswithme.maps.purchase.PurchaseUtils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
class InvalidSubscriptionAlertDialogCallback implements AlertDialogCallback
{
@@ -24,8 +23,7 @@ class InvalidSubscriptionAlertDialogCallback implements AlertDialogCallback
public void onAlertDialogPositiveClick(int requestCode, int which)
{
BookmarksAllSubscriptionActivity.startForResult(mFragment,
- PurchaseUtils.REQ_CODE_PAY_CONTINUE_SUBSCRIPTION,
- Statistics.ParamValue.POPUP);
+ PurchaseUtils.REQ_CODE_PAY_CONTINUE_SUBSCRIPTION);
}
@Override
diff --git a/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java b/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java
index 25ccba3876..581f604639 100644
--- a/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java
+++ b/android/src/com/mapswithme/maps/bookmarks/ShowOnMapCatalogCategoryFragment.java
@@ -1,7 +1,6 @@
package com.mapswithme.maps.bookmarks;
import android.app.Activity;
-import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
@@ -13,7 +12,6 @@ import android.view.ViewGroup;
import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.BookmarkCategory;
-import com.mapswithme.util.statistics.Statistics;
public class ShowOnMapCatalogCategoryFragment extends DialogFragment
{
@@ -57,13 +55,11 @@ public class ShowOnMapCatalogCategoryFragment extends DialogFragment
private void onDeclined()
{
- Statistics.INSTANCE.trackDownloadBookmarkDialog(Statistics.ParamValue.NOT_NOW);
dismissAllowingStateLoss();
}
private void onAccepted()
{
- Statistics.INSTANCE.trackDownloadBookmarkDialog(Statistics.ParamValue.VIEW_ON_MAP);
Intent result = new Intent().putExtra(BookmarksCatalogActivity.EXTRA_DOWNLOADED_CATEGORY,
mCategory);
getActivity().setResult(Activity.RESULT_OK, result);
@@ -71,13 +67,6 @@ public class ShowOnMapCatalogCategoryFragment extends DialogFragment
getActivity().finish();
}
- @Override
- public void onCancel(DialogInterface dialog)
- {
- super.onCancel(dialog);
- Statistics.INSTANCE.trackDownloadBookmarkDialog(Statistics.ParamValue.CLICK_OUTSIDE);
- }
-
void setCategory(@NonNull BookmarkCategory category)
{
mCategory = category;
diff --git a/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java b/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java
index 1e5c163cdb..7340787312 100644
--- a/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java
+++ b/android/src/com/mapswithme/maps/bookmarks/data/BookmarkManager.java
@@ -13,7 +13,6 @@ import com.mapswithme.maps.base.Observable;
import com.mapswithme.maps.metrics.UserActionsLogger;
import com.mapswithme.util.KeyValue;
import com.mapswithme.util.UTM;
-import com.mapswithme.util.statistics.Statistics;
import java.io.File;
import java.lang.annotation.Retention;
@@ -138,28 +137,12 @@ public enum BookmarkManager
{
boolean isVisible = isVisible(category.getId());
setVisibility(category.getId(), !isVisible);
- Statistics.INSTANCE.trackBookmarksVisibility(Statistics.ParamValue.BOOKMARK_LIST,
- isVisible ? Statistics.ParamValue.HIDE
- : Statistics.ParamValue.SHOW,
- category.isFromCatalog() ? category.getServerId()
- : null);
- String compilationTypeString = type == BookmarkManager.CATEGORY ?
- Statistics.ParamValue.CATEGORY :
- Statistics.ParamValue.COLLECTION;
- Statistics.INSTANCE.trackGuideVisibilityChange(
- isVisible ? Statistics.ParamValue.HIDE : Statistics.ParamValue.SHOW,
- category.getServerId(), compilationTypeString);
}
public void toggleCategoryVisibility(@NonNull BookmarkCategory category)
{
boolean isVisible = isVisible(category.getId());
setVisibility(category.getId(), !isVisible);
- Statistics.INSTANCE.trackBookmarksVisibility(Statistics.ParamValue.BOOKMARK_LIST,
- isVisible ? Statistics.ParamValue.HIDE
- : Statistics.ParamValue.SHOW,
- category.isFromCatalog() ? category.getServerId()
- : null);
}
@Nullable
@@ -169,7 +152,6 @@ public enum BookmarkManager
if (bookmark != null)
{
UserActionsLogger.logAddToBookmarkEvent();
- Statistics.INSTANCE.trackBookmarkCreated();
}
return bookmark;
}
@@ -399,8 +381,6 @@ public enum BookmarkManager
@MainThread
public void onImportFinished(@NonNull String id, long catId, boolean successful)
{
- if (successful)
- Statistics.INSTANCE.trackPurchaseProductDelivered(id, PrivateVariables.bookmarksVendor());
for (BookmarksCatalogListener listener : mCatalogListeners)
listener.onImportFinished(id, catId, successful);
}
diff --git a/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java b/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java
index a2ea890e03..dab3809dfa 100644
--- a/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java
+++ b/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java
@@ -42,18 +42,7 @@ import com.mapswithme.util.Language;
import com.mapswithme.util.NetworkPolicy;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.GalleryType;
-import com.mapswithme.util.statistics.Statistics;
-import static com.mapswithme.util.statistics.Destination.EXTERNAL;
-import static com.mapswithme.util.statistics.Destination.PLACEPAGE;
-import static com.mapswithme.util.statistics.Destination.ROUTING;
-import static com.mapswithme.util.statistics.GalleryPlacement.DISCOVERY;
-import static com.mapswithme.util.statistics.GalleryType.LOCAL_EXPERTS;
-import static com.mapswithme.util.statistics.GalleryType.PROMO;
-import static com.mapswithme.util.statistics.GalleryType.SEARCH_ATTRACTIONS;
-import static com.mapswithme.util.statistics.GalleryType.SEARCH_HOTELS;
-import static com.mapswithme.util.statistics.GalleryType.SEARCH_RESTAURANTS;
public class DiscoveryFragment extends BaseMwmToolbarFragment implements DiscoveryResultReceiver
{
@@ -239,11 +228,9 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
{
updateViewsVisibility(results, R.id.attractionsTitle, R.id.attractions);
ItemSelectedListener listener = new SearchBasedListener(this,
- SEARCH_ATTRACTIONS,
ItemType.ATTRACTIONS);
RecyclerView gallery = getGallery(R.id.attractions);
- GalleryAdapter adapter = Factory.createSearchBasedAdapter(results, listener, SEARCH_ATTRACTIONS,
- DISCOVERY,
+ GalleryAdapter adapter = Factory.createSearchBasedAdapter(results, listener,
new Items.MoreSearchItem(requireContext()));
gallery.setAdapter(adapter);
}
@@ -254,11 +241,9 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
{
updateViewsVisibility(results, R.id.eatAndDrinkTitle, R.id.food);
ItemSelectedListener listener = new SearchBasedListener(this,
- SEARCH_RESTAURANTS,
ItemType.CAFES);
RecyclerView gallery = getGallery(R.id.food);
- gallery.setAdapter(Factory.createSearchBasedAdapter(results, listener, SEARCH_RESTAURANTS,
- DISCOVERY,
+ gallery.setAdapter(Factory.createSearchBasedAdapter(results, listener,
new Items.MoreSearchItem(requireContext())));
}
@@ -267,8 +252,7 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
{
updateViewsVisibility(results, R.id.hotelsTitle, R.id.hotels);
ItemSelectedListener listener = new HotelListener(this);
- GalleryAdapter adapter = Factory.createHotelAdapter(requireContext(), results, listener,
- SEARCH_HOTELS, DISCOVERY);
+ GalleryAdapter adapter = Factory.createHotelAdapter(requireContext(), results, listener);
RecyclerView gallery = getGallery(R.id.hotels);
gallery.setAdapter(adapter);
}
@@ -281,10 +265,10 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
String url = DiscoveryManager.nativeGetLocalExpertsUrl();
ItemSelectedListener listener
- = createOnlineProductItemListener(LOCAL_EXPERTS, ItemType.LOCAL_EXPERTS);
+ = createOnlineProductItemListener(ItemType.LOCAL_EXPERTS);
RecyclerView gallery = getGallery(R.id.localGuides);
- GalleryAdapter adapter = Factory.createLocalExpertsAdapter(experts, url, listener, DISCOVERY);
+ GalleryAdapter adapter = Factory.createLocalExpertsAdapter(experts, url, listener);
gallery.setAdapter(adapter);
}
@@ -298,9 +282,8 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
String url = gallery.getMoreUrl();
ItemSelectedListener listener =
- new RegularCatalogPromoListener(requireActivity(), DISCOVERY);
- GalleryAdapter adapter = Factory.createCatalogPromoAdapter(requireContext(), gallery, url,
- listener, DISCOVERY);
+ new RegularCatalogPromoListener(requireActivity());
+ GalleryAdapter adapter = Factory.createCatalogPromoAdapter(requireContext(), gallery, url, listener);
RecyclerView recycler = getGallery(R.id.catalog_promo_recycler);
recycler.setAdapter(adapter);
}
@@ -312,26 +295,21 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
{
case HOTELS:
getGallery(R.id.hotels).setAdapter(Factory.createSearchBasedErrorAdapter(requireContext()));
- Statistics.INSTANCE.trackGalleryError(SEARCH_HOTELS, DISCOVERY, null);
break;
case ATTRACTIONS:
getGallery(R.id.attractions).setAdapter(Factory.createSearchBasedErrorAdapter(requireContext()));
- Statistics.INSTANCE.trackGalleryError(SEARCH_ATTRACTIONS, DISCOVERY, null);
break;
case CAFES:
getGallery(R.id.food).setAdapter(Factory.createSearchBasedErrorAdapter(requireContext()));
- Statistics.INSTANCE.trackGalleryError(SEARCH_RESTAURANTS, DISCOVERY, null);
break;
case LOCAL_EXPERTS:
getGallery(R.id.localGuides).setAdapter(Factory.createLocalExpertsErrorAdapter(requireContext()));
- Statistics.INSTANCE.trackGalleryError(LOCAL_EXPERTS, DISCOVERY, null);
break;
case PROMO:
GalleryAdapter adapter = Factory.createCatalogPromoErrorAdapter(requireContext(),
new ErrorCatalogPromoListener<>(requireActivity(), this::onNetworkPolicyResult));
RecyclerView gallery = getGallery(R.id.catalog_promo_recycler);
gallery.setAdapter(adapter);
- Statistics.INSTANCE.trackGalleryError(PROMO, DISCOVERY, null);
break;
default:
throw new AssertionError("Unknown item type: " + type);
@@ -422,24 +400,18 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
};
}
- private ItemSelectedListener createOnlineProductItemListener(@NonNull GalleryType galleryType,
- @NonNull ItemType itemType)
+ private ItemSelectedListener createOnlineProductItemListener(@NonNull ItemType itemType)
{
return new LoggableItemSelectedListener(getActivity(), itemType)
{
@Override
public void onItemSelectedInternal(@NonNull I item, int position)
{
- Statistics.INSTANCE.trackGalleryProductItemSelected(galleryType, DISCOVERY, position,
- EXTERNAL);
}
@Override
public void onMoreItemSelectedInternal(@NonNull I item)
{
- Statistics.INSTANCE.trackGalleryEvent(Statistics.EventName.PP_SPONSOR_MORE_SELECTED,
- galleryType,
- DISCOVERY);
}
};
}
@@ -449,16 +421,11 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
@NonNull
private final DiscoveryFragment mFragment;
- @NonNull
- private final GalleryType mType;
-
private SearchBasedListener(@NonNull DiscoveryFragment fragment,
- @NonNull GalleryType galleryType,
@NonNull ItemType itemType)
{
super(fragment.getActivity(), itemType);
mFragment = fragment;
- mType = galleryType;
}
@Override
@@ -478,7 +445,6 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
public void onItemSelectedInternal(@NonNull Items.SearchItem item, int position)
{
mFragment.showOnMap(item);
- Statistics.INSTANCE.trackGalleryProductItemSelected(mType, DISCOVERY, position, PLACEPAGE);
}
@Override
@@ -486,8 +452,6 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
public void onActionButtonSelected(@NonNull Items.SearchItem item, int position)
{
mFragment.routeTo(item);
- Statistics.INSTANCE.trackGalleryProductItemSelected(mType, DISCOVERY, position,
- ROUTING);
}
@NonNull
@@ -501,15 +465,13 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove
{
private HotelListener(@NonNull DiscoveryFragment fragment)
{
- super(fragment, SEARCH_HOTELS, ItemType.HOTELS);
+ super(fragment, ItemType.HOTELS);
}
@Override
public void onMoreItemSelectedInternal(@NonNull Items.SearchItem item)
{
getFragment().showFilter();
- Statistics.INSTANCE.trackGalleryEvent(Statistics.EventName.PP_SPONSOR_MORE_SELECTED,
- SEARCH_HOTELS, DISCOVERY);
}
}
diff --git a/android/src/com/mapswithme/maps/downloader/BottomPanel.java b/android/src/com/mapswithme/maps/downloader/BottomPanel.java
index e844730107..b0d06f5129 100644
--- a/android/src/com/mapswithme/maps/downloader/BottomPanel.java
+++ b/android/src/com/mapswithme/maps/downloader/BottomPanel.java
@@ -9,7 +9,6 @@ import java.util.Locale;
import com.mapswithme.maps.R;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
class BottomPanel
{
@@ -22,18 +21,7 @@ class BottomPanel
@Override
public void onClick(View v)
{
- MapManager.warn3gAndDownload(mFragment.getActivity(), mFragment.getCurrentRoot(), new Runnable()
- {
- @Override
- public void run()
- {
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
- Statistics.params().add(Statistics.EventParam.ACTION, "download")
- .add(Statistics.EventParam.FROM, "downloader")
- .add("is_auto", "false")
- .add("scenario", "download_group"));
- }
- });
+ MapManager.warn3gAndDownload(mFragment.getActivity(), mFragment.getCurrentRoot(), null);
}
};
@@ -49,12 +37,6 @@ class BottomPanel
public void run()
{
MapManager.nativeUpdate(country);
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
- Statistics.params().add(Statistics.EventParam.ACTION, "update")
- .add(Statistics.EventParam.FROM, "downloader")
- .add("is_auto", "false")
- .add("scenario", "update_all"));
}
});
}
@@ -66,9 +48,6 @@ class BottomPanel
public void onClick(View v)
{
MapManager.nativeCancel(mFragment.getCurrentRoot());
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
- Statistics.params().add(Statistics.EventParam.FROM, "downloader"));
}
};
@@ -84,9 +63,6 @@ class BottomPanel
{
if (mFragment.getAdapter() != null )
mFragment.getAdapter().setAvailableMapsMode();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_FAB_CLICK,
- Statistics.params().add(Statistics.EventParam.BUTTON,
- Statistics.ParamValue.PLUS));
update();
}
});
diff --git a/android/src/com/mapswithme/maps/downloader/CountrySuggestFragment.java b/android/src/com/mapswithme/maps/downloader/CountrySuggestFragment.java
index c9eaee704f..00bf98d19b 100644
--- a/android/src/com/mapswithme/maps/downloader/CountrySuggestFragment.java
+++ b/android/src/com/mapswithme/maps/downloader/CountrySuggestFragment.java
@@ -17,11 +17,9 @@ import java.util.Locale;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmFragment;
import com.mapswithme.maps.location.LocationHelper;
-import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.maps.widget.WheelProgressView;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
public class CountrySuggestFragment extends BaseMwmFragment implements View.OnClickListener
{
@@ -219,9 +217,6 @@ public class CountrySuggestFragment extends BaseMwmFragment implements View.OnCl
case R.id.wpv__download_progress:
MapManager.nativeCancel(mDownloadingCountry.id);
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
- Statistics.params().add(Statistics.EventParam.FROM, "search"));
break;
}
}
diff --git a/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java b/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java
index 64dee0fd8a..42de9e8768 100644
--- a/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java
+++ b/android/src/com/mapswithme/maps/downloader/DownloaderAdapter.java
@@ -32,7 +32,6 @@ import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.util.BottomSheetHelper;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersAdapter;
import com.timehop.stickyheadersrecyclerview.StickyRecyclerHeadersDecoration;
@@ -77,19 +76,7 @@ class DownloaderAdapter extends RecyclerView.Adapter dialogClickListener)
{
diff --git a/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java b/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java
index 19558ccadb..dfb79e3b5c 100644
--- a/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java
+++ b/android/src/com/mapswithme/maps/downloader/OnmapDownloader.java
@@ -20,7 +20,6 @@ import com.mapswithme.util.Config;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
import java.util.Locale;
@@ -173,12 +172,6 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
MapManager.nativeHasSpaceToDownloadCountry(country))
{
MapManager.nativeDownload(mCurrentCountry.id);
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
- Statistics.params().add(Statistics.EventParam.ACTION, "download")
- .add(Statistics.EventParam.FROM, "map")
- .add("is_auto", "true")
- .add("scenario", "download"));
}
}
}
@@ -216,43 +209,23 @@ public class OnmapDownloader implements MwmActivity.LeftAnimationTrackListener
return;
MapManager.nativeCancel(mCurrentCountry.id);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_CANCEL,
- Statistics.params().add(Statistics.EventParam.FROM, "map"));
setAutodownloadLocked(true);
}
});
final Notifier notifier = Notifier.from(activity.getApplication());
- mButton.setOnClickListener(new View.OnClickListener()
- {
- @Override
- public void onClick(View v)
+ mButton.setOnClickListener(v -> MapManager.warnOn3g(mActivity, mCurrentCountry == null ? null : mCurrentCountry.id, () -> {
+ if (mCurrentCountry == null)
+ return;
+
+ boolean retry = (mCurrentCountry.status == CountryItem.STATUS_FAILED);
+ if (retry)
{
- MapManager.warnOn3g(mActivity, mCurrentCountry == null ? null : mCurrentCountry.id, new Runnable()
- {
- @Override
- public void run()
- {
- if (mCurrentCountry == null)
- return;
-
- boolean retry = (mCurrentCountry.status == CountryItem.STATUS_FAILED);
- if (retry)
- {
- notifier.cancelNotification(Notifier.ID_DOWNLOAD_FAILED);
- MapManager.nativeRetry(mCurrentCountry.id);
- }
- else
- MapManager.nativeDownload(mCurrentCountry.id);
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.DOWNLOADER_ACTION,
- Statistics.params().add(Statistics.EventParam.ACTION, (retry ? "retry" : "download"))
- .add(Statistics.EventParam.FROM, "map")
- .add("is_auto", "false")
- .add("scenario", "download"));
- }
- });
+ notifier.cancelNotification(Notifier.ID_DOWNLOAD_FAILED);
+ MapManager.nativeRetry(mCurrentCountry.id);
}
- });
+ else
+ MapManager.nativeDownload(mCurrentCountry.id);
+ }));
mPromoContentDivider = mFrame.findViewById(R.id.onmap_downloader_divider);
}
diff --git a/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java b/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java
index de2279d45c..bf4dea8232 100644
--- a/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java
+++ b/android/src/com/mapswithme/maps/downloader/UpdaterDialogFragment.java
@@ -25,19 +25,12 @@ import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_CANCEL;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_DOWNLOAD;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_HIDE;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_LATER;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_MANUAL_DOWNLOAD;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_SHOW;
public class UpdaterDialogFragment extends BaseMwmDialogFragment
{
@@ -91,21 +84,11 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment
}
@NonNull
- private final View.OnClickListener mFinishClickListener = (View v) ->
- {
- Statistics.INSTANCE.trackDownloaderDialogEvent(mAutoUpdate ?
- DOWNLOADER_DIALOG_HIDE :
- DOWNLOADER_DIALOG_LATER, 0);
-
- finish();
- };
+ private final View.OnClickListener mFinishClickListener = (View v) -> finish();
@NonNull
private final View.OnClickListener mCancelClickListener = (View v) ->
{
- Statistics.INSTANCE.trackDownloaderDialogEvent(DOWNLOADER_DIALOG_CANCEL,
- mTotalSizeBytes / Constants.MB);
-
MapManager.nativeCancel(CountryItem.getRootId());
final UpdateInfo info = MapManager.nativeGetUpdateInfo(CountryItem.getRootId());
@@ -144,9 +127,6 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment
MapManager.nativeUpdate(CountryItem.getRootId());
UiUtils.show(mProgressBar, mInfo);
UiUtils.hide(mUpdateBtn);
-
- Statistics.INSTANCE.trackDownloaderDialogEvent(DOWNLOADER_DIALOG_MANUAL_DOWNLOAD,
- mTotalSizeBytes / Constants.MB);
}
});
@@ -174,9 +154,6 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment
result = Framework.nativeToDoAfterUpdate();
if (result == Framework.DO_AFTER_UPDATE_NOTHING)
return false;
-
- Statistics.INSTANCE.trackDownloaderDialogEvent(DOWNLOADER_DIALOG_SHOW,
- info.totalSize / Constants.MB);
}
final Bundle args = new Bundle();
@@ -278,16 +255,7 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment
{
if (!MapManager.nativeIsDownloading())
{
- MapManager.warnOn3gUpdate(getActivity(), CountryItem.getRootId(), new Runnable()
- {
- @Override
- public void run()
- {
- MapManager.nativeUpdate(CountryItem.getRootId());
- Statistics.INSTANCE.trackDownloaderDialogEvent(DOWNLOADER_DIALOG_DOWNLOAD,
- mTotalSizeBytes / Constants.MB);
- }
- });
+ MapManager.warnOn3gUpdate(getActivity(), CountryItem.getRootId(), () -> MapManager.nativeUpdate(CountryItem.getRootId()));
}
else
{
@@ -523,33 +491,18 @@ public class UpdaterDialogFragment extends BaseMwmDialogFragment
default:
text = String.valueOf(item.errorCode);
}
- //noinspection ConstantConditions
- Statistics.INSTANCE.trackDownloaderDialogError(mFragment.getTotalSizeBytes() / Constants.MB,
- text);
- MapManager.showErrorDialog(mFragment.getActivity(), item, new Utils.Proc()
- {
- @Override
- public void invoke(@NonNull Boolean result)
- {
- if (!isFragmentAttached())
- return;
+ MapManager.showErrorDialog(mFragment.getActivity(), item, result -> {
+ if (!isFragmentAttached())
+ return;
- if (result)
- {
- MapManager.warnOn3gUpdate(mFragment.getActivity(), CountryItem.getRootId(), new Runnable()
- {
- @Override
- public void run()
- {
- MapManager.nativeUpdate(CountryItem.getRootId());
- }
- });
- }
- else
- {
- MapManager.nativeCancel(CountryItem.getRootId());
- mFragment.finish();
- }
+ if (result)
+ {
+ MapManager.warnOn3gUpdate(mFragment.getActivity(), CountryItem.getRootId(), () -> MapManager.nativeUpdate(CountryItem.getRootId()));
+ }
+ else
+ {
+ MapManager.nativeCancel(CountryItem.getRootId());
+ mFragment.finish();
}
});
}
diff --git a/android/src/com/mapswithme/maps/editor/AuthDialogFragment.java b/android/src/com/mapswithme/maps/editor/AuthDialogFragment.java
index 10df25d0a1..9b0188e882 100644
--- a/android/src/com/mapswithme/maps/editor/AuthDialogFragment.java
+++ b/android/src/com/mapswithme/maps/editor/AuthDialogFragment.java
@@ -13,31 +13,11 @@ import android.view.ViewGroup;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Objects;
public class AuthDialogFragment extends BaseMwmDialogFragment
{
-
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- Bundle args = getArguments();
- if (args == null)
- return;
-
- sendStats(args, Statistics.EventName.AUTH_SHOWN);
- }
-
- @NonNull
- @Override
- public Dialog onCreateDialog(@Nullable Bundle savedInstanceState)
- {
- return new DialogImpl();
- }
-
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
@@ -59,12 +39,6 @@ public class AuthDialogFragment extends BaseMwmDialogFragment
osmAuthDelegate.onViewCreated(view, savedInstanceState);
}
- private static void sendStats(@NonNull Bundle args, @NonNull String action)
- {
- Statistics.INSTANCE.trackAuthDialogAction(action,
- Objects.requireNonNull(args.getString(Statistics.EventParam.FROM)));
- }
-
private class AuthFragmentDelegate extends OsmAuthFragmentDelegate
{
AuthFragmentDelegate()
@@ -77,28 +51,6 @@ public class AuthDialogFragment extends BaseMwmDialogFragment
{
startActivity(new Intent(getContext(), OsmAuthActivity.class));
dismiss();
- if (getArguments() == null)
- return;
-
- sendStats(getArguments(), Statistics.EventName.AUTH_START);
- }
- }
-
- private class DialogImpl extends Dialog
- {
- DialogImpl()
- {
- super(requireActivity(), getTheme());
- }
-
- @Override
- public void onBackPressed()
- {
- super.onBackPressed();
- if (getArguments() == null)
- return;
-
- sendStats(getArguments(), Statistics.EventName.AUTH_DECLINED);
}
}
}
diff --git a/android/src/com/mapswithme/maps/editor/AuthFragment.java b/android/src/com/mapswithme/maps/editor/AuthFragment.java
index 600a4f912c..90a7f9a653 100644
--- a/android/src/com/mapswithme/maps/editor/AuthFragment.java
+++ b/android/src/com/mapswithme/maps/editor/AuthFragment.java
@@ -11,7 +11,6 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.base.BaseMwmToolbarFragment;
import com.mapswithme.maps.widget.ToolbarController;
-import com.mapswithme.util.statistics.Statistics;
public class AuthFragment extends BaseMwmToolbarFragment
{
@@ -47,7 +46,6 @@ public class AuthFragment extends BaseMwmToolbarFragment
@Override
public void onUpClick()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_DECLINED);
super.onUpClick();
}
};
diff --git a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java
index 71642ab068..6c467a6cc2 100644
--- a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java
+++ b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java
@@ -33,7 +33,6 @@ import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.KeyValue;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.List;
@@ -316,16 +315,12 @@ public class EditorHostFragment extends BaseMwmToolbarFragment
private void processNoFeatures()
{
- Statistics.INSTANCE.trackEditorError(mIsNewObject,
- String.valueOf(OsmOAuth.isAuthorized(requireContext())));
DialogUtils.showAlertDialog(getActivity(), R.string.downloader_no_space_title);
}
private void processEditedFeatures()
{
Context context = requireContext();
- Statistics.INSTANCE.trackEditorSuccess(mIsNewObject,
- String.valueOf(OsmOAuth.isAuthorized(context)));
if (OsmOAuth.isAuthorized(context) || !ConnectionState.INSTANCE.isConnected())
{
Utils.navigateToParent(getActivity());
@@ -345,22 +340,12 @@ public class EditorHostFragment extends BaseMwmToolbarFragment
private Intent makeParentActivityIntent()
{
Activity parent = getActivity();
- Factory.ShowDialogTask task = new Factory.ShowDialogTask(AuthDialogFragment.class.getName(),
- makeParams());
+ Factory.ShowDialogTask task = new Factory.ShowDialogTask(AuthDialogFragment.class.getName());
return new Intent(parent, MwmActivity.class)
.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
.putExtra(MwmActivity.EXTRA_TASK, task);
}
- private ArrayList makeParams()
- {
- ArrayList params = new ArrayList<>();
- params.add(new KeyValue(Statistics.EventParam.FROM, mIsNewObject
- ? Statistics.ParamValue.NEW_OBJECT
- : Statistics.ParamValue.EDIT_OBJECT));
- return params;
- }
-
private void saveNote()
{
String tag = EditorFragment.class.getName();
diff --git a/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java b/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java
index 44b5a8c72c..fc58935a81 100644
--- a/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java
+++ b/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java
@@ -25,7 +25,6 @@ import com.mapswithme.util.ThemeUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.concurrency.ThreadPool;
import com.mapswithme.util.concurrency.UiThread;
-import com.mapswithme.util.statistics.Statistics;
public class OsmAuthFragment extends BaseMwmToolbarFragment implements View.OnClickListener
{
@@ -145,7 +144,6 @@ public class OsmAuthFragment extends BaseMwmToolbarFragment implements View.OnCl
private void recoverPassword()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_LOST_PASSWORD);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.OSM_RECOVER_PASSWORD)));
}
}
diff --git a/android/src/com/mapswithme/maps/editor/OsmAuthFragmentDelegate.java b/android/src/com/mapswithme/maps/editor/OsmAuthFragmentDelegate.java
index 7cec96f239..73682cb583 100644
--- a/android/src/com/mapswithme/maps/editor/OsmAuthFragmentDelegate.java
+++ b/android/src/com/mapswithme/maps/editor/OsmAuthFragmentDelegate.java
@@ -13,7 +13,6 @@ import android.view.View;
import com.mapswithme.maps.R;
import com.mapswithme.util.Constants;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
public abstract class OsmAuthFragmentDelegate implements View.OnClickListener
{
@@ -43,11 +42,9 @@ public abstract class OsmAuthFragmentDelegate implements View.OnClickListener
switch (v.getId())
{
case R.id.login_osm:
- Statistics.INSTANCE.trackAuthRequest(OsmOAuth.AuthType.OSM);
loginOsm();
break;
case R.id.register:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_REG_REQUEST);
register();
break;
}
@@ -61,21 +58,13 @@ public abstract class OsmAuthFragmentDelegate implements View.OnClickListener
{
new AlertDialog.Builder(mFragment.getActivity()).setTitle(R.string.editor_login_error_dialog)
.setPositiveButton(android.R.string.ok, null).show();
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST_RESULT,
- Statistics.params().add(Statistics.EventParam.IS_SUCCESS, false).add(Statistics.EventParam.TYPE, type.name));
}
-
- Statistics.INSTANCE.trackOsmAuthRequestStats(Statistics.EventName.AUTH_ERROR);
return;
}
OsmOAuth.setAuthorization(mFragment.requireContext(), auth[0], auth[1], username);
if (mFragment.isAdded())
Utils.navigateToParent(mFragment.getActivity());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_AUTH_REQUEST_RESULT,
- Statistics.params().add(Statistics.EventParam.IS_SUCCESS, true).add(Statistics.EventParam.TYPE, type.name));
- Statistics.INSTANCE.trackOsmAuthRequestStats(Statistics.EventName.AUTH_EXTERNAL_REQUEST_SUCCESS);
}
protected void register()
diff --git a/android/src/com/mapswithme/maps/editor/ViralFragment.java b/android/src/com/mapswithme/maps/editor/ViralFragment.java
index d6bf4f2a36..811affe47a 100644
--- a/android/src/com/mapswithme/maps/editor/ViralFragment.java
+++ b/android/src/com/mapswithme/maps/editor/ViralFragment.java
@@ -18,7 +18,6 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.sharing.SharingHelper;
-import com.mapswithme.util.statistics.Statistics;
public class ViralFragment extends BaseMwmDialogFragment
{
@@ -65,7 +64,6 @@ public class ViralFragment extends BaseMwmDialogFragment
dismiss();
if (mDismissListener != null)
mDismissListener.run();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_SHARE_CLICK);
});
view.findViewById(R.id.close).setOnClickListener(v -> {
@@ -73,10 +71,6 @@ public class ViralFragment extends BaseMwmDialogFragment
if (mDismissListener != null)
mDismissListener.run();
});
-
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_SHARE_SHOW,
- Statistics.params()
- .add("showed", viralText.equals(viralChangesMsg) ? "change" : "rating"));
}
@Override
diff --git a/android/src/com/mapswithme/maps/gallery/Holders.java b/android/src/com/mapswithme/maps/gallery/Holders.java
index 93075e95c9..ffa7469906 100644
--- a/android/src/com/mapswithme/maps/gallery/Holders.java
+++ b/android/src/com/mapswithme/maps/gallery/Holders.java
@@ -44,7 +44,6 @@ import com.mapswithme.util.StringUtils;
import com.mapswithme.util.ThemeUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
import java.util.Objects;
@@ -614,10 +613,6 @@ public class Holders
BookmarkManager.INSTANCE.getCategoryByServerId(item.getGuideId());
boolean isVisible = category.isVisible();
BookmarkManager.INSTANCE.setVisibility(category.getId(), !isVisible);
- Statistics.INSTANCE.trackBookmarksVisibility(Statistics.ParamValue.MAP_GALLERY,
- isVisible ? Statistics.ParamValue.HIDE
- : Statistics.ParamValue.SHOW,
- item.getGuideId());
mBoughtContentBtn.setText(!isVisible ? R.string.hide : R.string.show);
}
diff --git a/android/src/com/mapswithme/maps/gallery/impl/Factory.java b/android/src/com/mapswithme/maps/gallery/impl/Factory.java
index c6e98be309..f064bd39ee 100644
--- a/android/src/com/mapswithme/maps/gallery/impl/Factory.java
+++ b/android/src/com/mapswithme/maps/gallery/impl/Factory.java
@@ -15,16 +15,9 @@ import com.mapswithme.maps.promo.PromoCityGallery;
import com.mapswithme.maps.promo.PromoEntity;
import com.mapswithme.maps.search.SearchResult;
import com.mapswithme.maps.widget.placepage.PlacePageView;
-import com.mapswithme.util.statistics.GalleryPlacement;
-import com.mapswithme.util.statistics.GalleryState;
-import com.mapswithme.util.statistics.GalleryType;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
-import static com.mapswithme.util.statistics.GalleryState.OFFLINE;
-import static com.mapswithme.util.statistics.GalleryState.ONLINE;
-import static com.mapswithme.util.statistics.GalleryType.LOCAL_EXPERTS;
public class Factory
{
@@ -32,11 +25,8 @@ public class Factory
public static GalleryAdapter createSearchBasedAdapter(@NonNull SearchResult[] results,
@Nullable ItemSelectedListener listener,
- @NonNull GalleryType type,
- @NonNull GalleryPlacement placement,
@Nullable Items.MoreSearchItem item)
{
- trackProductGalleryShownOrError(results, type, OFFLINE, placement);
return new GalleryAdapter<>(new SearchBasedAdapterStrategy(results, item, listener));
}
@@ -56,11 +46,8 @@ public class Factory
public static GalleryAdapter createHotelAdapter(@NonNull Context context,
@NonNull SearchResult[] results,
@Nullable ItemSelectedListener listener,
- @NonNull GalleryType type,
- @NonNull GalleryPlacement placement)
+ .SearchItem> listener)
{
- trackProductGalleryShownOrError(results, type, OFFLINE, placement);
return new GalleryAdapter<>(new HotelAdapterStrategy(context, results, listener));
}
@@ -68,10 +55,8 @@ public class Factory
public static GalleryAdapter createLocalExpertsAdapter(@NonNull LocalExpert[] experts,
@Nullable String expertsUrl,
@Nullable ItemSelectedListener listener,
- @NonNull GalleryPlacement placement)
+ .LocalExpertItem> listener)
{
- trackProductGalleryShownOrError(experts, LOCAL_EXPERTS, ONLINE, placement);
return new GalleryAdapter<>(new LocalExpertsAdapterStrategy(experts, expertsUrl, listener));
}
@@ -85,8 +70,7 @@ public class Factory
public static GalleryAdapter createCatalogPromoAdapter(@NonNull Context context,
@NonNull PromoCityGallery gallery,
@Nullable String url,
- @Nullable ItemSelectedListener listener,
- @NonNull GalleryPlacement placement)
+ @Nullable ItemSelectedListener listener)
{
@SuppressWarnings("ConstantConditions")
PromoEntity item = new PromoEntity(Constants.TYPE_MORE,
@@ -96,18 +80,14 @@ public class Factory
CatalogPromoAdapterStrategy strategy = new CatalogPromoAdapterStrategy(entities,
item,
listener);
- trackProductGalleryShownOrError(gallery.getItems(), GalleryType.PROMO, ONLINE, placement);
return new GalleryAdapter<>(strategy);
}
@NonNull
public static GalleryAdapter createGuidesAdapter(
- @NonNull List items, @Nullable ItemSelectedListener listener,
- @NonNull GalleryPlacement placement)
+ @NonNull List items, @Nullable ItemSelectedListener listener)
{
GuidesAdapterStrategy strategy = new GuidesAdapterStrategy(items, listener);
- //noinspection ConstantConditions
- trackProductGalleryShownOrError(items.toArray(), GalleryType.PROMO, ONLINE, placement);
return new GalleryAdapter<>(strategy);
}
@@ -124,15 +104,4 @@ public class Factory
{
return new GalleryAdapter<>(new CatalogPromoErrorAdapterStrategy(context, listener));
}
-
- private static void trackProductGalleryShownOrError(@NonNull Product[] products,
- @NonNull GalleryType type,
- @NonNull GalleryState state,
- @NonNull GalleryPlacement placement)
- {
- if (products.length == 0)
- Statistics.INSTANCE.trackGalleryError(type, placement, Statistics.ParamValue.NO_PRODUCTS);
- else
- Statistics.INSTANCE.trackGalleryShown(type, state, placement, products.length);
- }
}
diff --git a/android/src/com/mapswithme/maps/gallery/impl/RegularCatalogPromoListener.java b/android/src/com/mapswithme/maps/gallery/impl/RegularCatalogPromoListener.java
index 440b4aa756..2be67b4cbe 100644
--- a/android/src/com/mapswithme/maps/gallery/impl/RegularCatalogPromoListener.java
+++ b/android/src/com/mapswithme/maps/gallery/impl/RegularCatalogPromoListener.java
@@ -10,22 +10,15 @@ import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.gallery.ItemSelectedListener;
import com.mapswithme.maps.promo.PromoEntity;
import com.mapswithme.util.UTM;
-import com.mapswithme.util.statistics.Destination;
-import com.mapswithme.util.statistics.GalleryPlacement;
-import com.mapswithme.util.statistics.GalleryType;
-import com.mapswithme.util.statistics.Statistics;
public class RegularCatalogPromoListener implements ItemSelectedListener
{
@NonNull
private final Activity mActivity;
- @NonNull
- private final GalleryPlacement mPlacement;
- public RegularCatalogPromoListener(@NonNull Activity activity, @NonNull GalleryPlacement placement)
+ public RegularCatalogPromoListener(@NonNull Activity activity)
{
mActivity = activity;
- mPlacement = placement;
}
@Override
@@ -38,8 +31,6 @@ public class RegularCatalogPromoListener implements ItemSelectedListener mKeyValues;
- public ShowDialogTask(@NonNull String dialogName, @NonNull ArrayList keyValues)
+ public ShowDialogTask(@NonNull String dialogName)
{
mDialogName = dialogName;
- mKeyValues = keyValues;
}
@Override
@@ -1305,7 +1236,6 @@ public class Factory
return true;
final DialogFragment fragment = (DialogFragment) Fragment.instantiate(target, mDialogName);
- fragment.setArguments(toDialogArgs(mKeyValues));
fragment.show(target.getSupportFragmentManager(), mDialogName);
return true;
}
@@ -1337,8 +1267,6 @@ public class Factory
target.setTutorial(tutorial);
tutorial.show(target, target);
- Statistics.INSTANCE.trackTipsEvent(Statistics.EventName.TIPS_TRICKS_SHOW,
- tutorial.ordinal());
return true;
}
}
diff --git a/android/src/com/mapswithme/maps/intent/MapTask.java b/android/src/com/mapswithme/maps/intent/MapTask.java
index d62220d5c4..f9563c8cd0 100644
--- a/android/src/com/mapswithme/maps/intent/MapTask.java
+++ b/android/src/com/mapswithme/maps/intent/MapTask.java
@@ -3,7 +3,6 @@ package com.mapswithme.maps.intent;
import androidx.annotation.NonNull;
import com.mapswithme.maps.MwmActivity;
-import com.mapswithme.util.statistics.StatisticValueConverter;
import java.io.Serializable;
diff --git a/android/src/com/mapswithme/maps/intent/MapTaskWithStatistics.java b/android/src/com/mapswithme/maps/intent/MapTaskWithStatistics.java
deleted file mode 100644
index d6e4c52f50..0000000000
--- a/android/src/com/mapswithme/maps/intent/MapTaskWithStatistics.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.mapswithme.maps.intent;
-
-import androidx.annotation.NonNull;
-import com.mapswithme.util.statistics.StatisticValueConverter;
-import com.mapswithme.util.statistics.Statistics;
-
-abstract class MapTaskWithStatistics implements MapTask, StatisticValueConverter
-{
- private static final long serialVersionUID = 3354057363011918229L;
-
- @NonNull
- public Statistics.ParameterBuilder toStatisticParams()
- {
- return Statistics.makeParametersFromType(toStatisticValue());
- }
-}
diff --git a/android/src/com/mapswithme/maps/intent/StatisticMapTaskWrapper.java b/android/src/com/mapswithme/maps/intent/StatisticMapTaskWrapper.java
deleted file mode 100644
index 02cc6e7fa7..0000000000
--- a/android/src/com/mapswithme/maps/intent/StatisticMapTaskWrapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.mapswithme.maps.intent;
-
-import androidx.annotation.NonNull;
-import com.mapswithme.maps.MwmActivity;
-import com.mapswithme.maps.MwmApplication;
-import com.mapswithme.util.statistics.Statistics;
-
-public class StatisticMapTaskWrapper implements MapTask
-{
- private static final long serialVersionUID = 7604577952712453816L;
- @NonNull
- private final MapTaskWithStatistics mMapTask;
-
- private StatisticMapTaskWrapper(@NonNull MapTaskWithStatistics mapTask)
- {
- mMapTask = mapTask;
- }
-
- @Override
- public boolean run(@NonNull MwmActivity target)
- {
- boolean success = mMapTask.run(target);
- boolean firstLaunch = MwmApplication.from(target).isFirstLaunch();
- if (success)
- Statistics.INSTANCE.trackDeeplinkEvent(Statistics.EventName.DEEPLINK_CALL,
- mMapTask.toStatisticParams(), firstLaunch);
- else
- Statistics.INSTANCE.trackDeeplinkEvent(Statistics.EventName.DEEPLINK_CALL_MISSED,
- mMapTask.toStatisticParams(), firstLaunch);
- return success;
- }
-
- @NonNull
- static MapTask wrap(@NonNull MapTaskWithStatistics task)
- {
- return new StatisticMapTaskWrapper(task);
- }
-}
diff --git a/android/src/com/mapswithme/maps/maplayer/AbstractIsoLinesClickListener.java b/android/src/com/mapswithme/maps/maplayer/AbstractIsoLinesClickListener.java
index 5e99b72d66..62f23c438e 100644
--- a/android/src/com/mapswithme/maps/maplayer/AbstractIsoLinesClickListener.java
+++ b/android/src/com/mapswithme/maps/maplayer/AbstractIsoLinesClickListener.java
@@ -8,7 +8,6 @@ import androidx.annotation.NonNull;
import com.mapswithme.maps.R;
import com.mapswithme.maps.maplayer.isolines.IsolinesManager;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Collections;
@@ -26,11 +25,6 @@ public abstract class AbstractIsoLinesClickListener extends DefaultClickListener
{
Context context = v.getContext();
if (IsolinesManager.from(context).shouldShowNotification())
- {
Utils.showSnackbar(context, v.getRootView(), R.string.isolines_toast_zooms_1_10);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.MAP_TOAST_SHOW,
- Collections.singletonMap(Statistics.EventParam.TYPE,
- Statistics.ParamValue.ISOLINES));
- }
}
}
diff --git a/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java b/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java
index 72247ae53a..97734a0189 100644
--- a/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java
+++ b/android/src/com/mapswithme/maps/maplayer/MapLayerCompositeController.java
@@ -12,7 +12,6 @@ import com.mapswithme.maps.maplayer.traffic.widget.TrafficButtonController;
import com.mapswithme.maps.tips.Tutorial;
import com.mapswithme.maps.tips.TutorialClickListener;
import com.mapswithme.util.InputUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.Collections;
@@ -325,7 +324,6 @@ public class MapLayerCompositeController implements MapLayerController
if (mCurrentLayer.getMode().isEnabled(mActivity))
{
Mode mode = getCurrentLayer().getMode();
- Statistics.INSTANCE.trackMapLayerClick(mode, Statistics.ParamValue.MAP, false);
turnOff();
toggleMode(mode);
}
diff --git a/android/src/com/mapswithme/maps/news/OnboardingStep.java b/android/src/com/mapswithme/maps/news/OnboardingStep.java
index 2e1aca8ac4..4718cf0a10 100644
--- a/android/src/com/mapswithme/maps/news/OnboardingStep.java
+++ b/android/src/com/mapswithme/maps/news/OnboardingStep.java
@@ -5,97 +5,40 @@ import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import com.mapswithme.maps.R;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.StatisticValueConverter;
-public enum OnboardingStep implements StatisticValueConverter
+public enum OnboardingStep
{
CHECK_OUT_SIGHTS(R.string.new_onboarding_step5_3_button,
R.string.later,
R.string.new_onboarding_step5_1_header,
- R.string.new_onboarding_step5_3_message)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "sample_discovery";
- }
- },
+ R.string.new_onboarding_step5_3_message),
SUBSCRIBE_TO_CATALOG(R.string.new_onboarding_step5_2_button,
R.string.later,
R.string.new_onboarding_step5_1_header,
- R.string.new_onboarding_step5_2_message)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "buy_subscription";
- }
- },
+ R.string.new_onboarding_step5_2_message),
DISCOVER_GUIDES(R.string.new_onboarding_step5_1_button,
R.string.later,
R.string.new_onboarding_step5_1_header,
- R.string.new_onboarding_step5_1_message)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "catalog_discovery";
- }
- },
+ R.string.new_onboarding_step5_1_message),
SHARE_EMOTIONS(R.string.new_onboarding_button_2,
UiUtils.NO_ID,
R.string.new_onboarding_step4_header,
R.string.new_onboarding_step4_message,
- false)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "share_emotions";
- }
- },
+ false),
EXPERIENCE(R.string.new_onboarding_button,
UiUtils.NO_ID,
R.string.new_onboarding_step3_header,
R.string.new_onboarding_step3_message,
- false)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "experience";
- }
- },
+ false),
DREAM_AND_PLAN(R.string.new_onboarding_button,
UiUtils.NO_ID,
R.string.new_onboarding_step2_header,
R.string.new_onboarding_step2_message,
- false)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "dream_and_plan";
- }
- },
+ false),
PERMISSION_EXPLANATION(R.string.new_onboarding_button,
R.string.learn_more,
R.string.onboarding_permissions_title,
- R.string.onboarding_permissions_message)
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "permissions";
- }
- };
+ R.string.onboarding_permissions_message);
@StringRes
private final int mAcceptButtonResId;
diff --git a/android/src/com/mapswithme/maps/onboarding/BaseNewsFragment.java b/android/src/com/mapswithme/maps/onboarding/BaseNewsFragment.java
index 544c7a0b10..6ac557cdef 100644
--- a/android/src/com/mapswithme/maps/onboarding/BaseNewsFragment.java
+++ b/android/src/com/mapswithme/maps/onboarding/BaseNewsFragment.java
@@ -33,7 +33,6 @@ import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.ThemeUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.List;
@@ -350,7 +349,6 @@ public abstract class BaseNewsFragment extends BaseMwmDialogFragment
@Override
public void onClick(View v)
{
- trackStatisticEvent(Statistics.ParamValue.NEXT);
mPager.setCurrentItem(mPager.getCurrentItem() + 1, true);
}
});
@@ -366,26 +364,15 @@ public abstract class BaseNewsFragment extends BaseMwmDialogFragment
update();
- trackStatisticEvent(Statistics.ParamValue.OPEN);
return res;
}
- private void trackStatisticEvent(@NonNull String value)
- {
- Statistics.ParameterBuilder builder = Statistics
- .params()
- .add(Statistics.EventParam.ACTION, value)
- .add(Statistics.EventParam.VERSION, BuildConfig.VERSION_NAME);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.WHATS_NEW_ACTION, builder);
- }
-
@CallSuper
protected void onDoneClick()
{
dismissAllowingStateLoss();
if (mListener != null)
mListener.onDialogDone();
- trackStatisticEvent(Statistics.ParamValue.CLOSE);
}
@SuppressWarnings("TryWithIdenticalCatches")
diff --git a/android/src/com/mapswithme/maps/onboarding/IntroductionDialogFragment.java b/android/src/com/mapswithme/maps/onboarding/IntroductionDialogFragment.java
index b435d14735..96033a1372 100644
--- a/android/src/com/mapswithme/maps/onboarding/IntroductionDialogFragment.java
+++ b/android/src/com/mapswithme/maps/onboarding/IntroductionDialogFragment.java
@@ -1,19 +1,16 @@
package com.mapswithme.maps.onboarding;
import android.app.Dialog;
-import android.content.DialogInterface;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import android.text.TextUtils;
import android.view.View;
-import android.widget.ImageView;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmDialogFragment;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
public class IntroductionDialogFragment extends BaseMwmDialogFragment
{
@@ -29,9 +26,6 @@ public class IntroductionDialogFragment extends BaseMwmDialogFragment
final IntroductionDialogFragment fragment = new IntroductionDialogFragment();
fragment.setArguments(args);
fragment.show(fm, IntroductionDialogFragment.class.getName());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ONBOARDING_DEEPLINK_SCREEN_SHOW,
- Statistics.params().add(Statistics.EventParam.TYPE,
- factory.toStatisticValue()));
}
@NonNull
@@ -72,21 +66,9 @@ public class IntroductionDialogFragment extends BaseMwmDialogFragment
throw new AssertionError("Deeplink must non-empty within introduction fragment!");
IntroductionScreenFactory factory = getScreenFactory();
factory.createButtonClickListener().onIntroductionButtonClick(requireActivity(), deepLink);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ONBOARDING_DEEPLINK_SCREEN_ACCEPT,
- Statistics.params().add(Statistics.EventParam.TYPE,
- factory.toStatisticValue()));
dismissAllowingStateLoss();
}
- @Override
- public void onCancel(DialogInterface dialog)
- {
- super.onCancel(dialog);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ONBOARDING_DEEPLINK_SCREEN_DECLINE,
- Statistics.params().add(Statistics.EventParam.TYPE,
- getScreenFactory().toStatisticValue()));
- }
-
@Override
protected int getCustomTheme()
{
diff --git a/android/src/com/mapswithme/maps/onboarding/IntroductionScreenFactory.java b/android/src/com/mapswithme/maps/onboarding/IntroductionScreenFactory.java
index 3ea4ce0e29..a95d52e1b5 100644
--- a/android/src/com/mapswithme/maps/onboarding/IntroductionScreenFactory.java
+++ b/android/src/com/mapswithme/maps/onboarding/IntroductionScreenFactory.java
@@ -9,19 +9,11 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity;
import com.mapswithme.maps.bookmarks.BookmarksCatalogActivity;
import com.mapswithme.maps.bookmarks.BookmarksPageFactory;
-import com.mapswithme.util.statistics.StatisticValueConverter;
-public enum IntroductionScreenFactory implements StatisticValueConverter
+public enum IntroductionScreenFactory
{
FREE_GUIDE
{
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "catalogue";
- }
-
@Override
public int getTitle()
{
@@ -50,27 +42,13 @@ public enum IntroductionScreenFactory implements StatisticValueConverter
@Override
public OnIntroductionButtonClickListener createButtonClickListener()
{
- return new OnIntroductionButtonClickListener()
- {
- @Override
- public void onIntroductionButtonClick(@NonNull Activity activity, @NonNull String deeplink)
- {
- BookmarkCategoriesActivity.startForResult(activity,
- BookmarksPageFactory.DOWNLOADED.ordinal(),
- deeplink);
- }
- };
+ return (activity, deeplink) -> BookmarkCategoriesActivity.startForResult(activity,
+ BookmarksPageFactory.DOWNLOADED.ordinal(),
+ deeplink);
}
},
GUIDES_PAGE
{
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "guides_page";
- }
-
@Override
public int getTitle()
{
@@ -99,17 +77,9 @@ public enum IntroductionScreenFactory implements StatisticValueConverter
@Override
public OnIntroductionButtonClickListener createButtonClickListener()
{
- return new OnIntroductionButtonClickListener()
- {
- @Override
- public void onIntroductionButtonClick(@NonNull Activity activity,
- @NonNull String deeplink)
- {
- BookmarksCatalogActivity.startForResult(activity,
- BookmarkCategoriesActivity.REQ_CODE_DOWNLOAD_BOOKMARK_CATEGORY,
- deeplink);
- }
- };
+ return (activity, deeplink) -> BookmarksCatalogActivity.startForResult(activity,
+ BookmarkCategoriesActivity.REQ_CODE_DOWNLOAD_BOOKMARK_CATEGORY,
+ deeplink);
}
};
diff --git a/android/src/com/mapswithme/maps/onboarding/NewsFragment.java b/android/src/com/mapswithme/maps/onboarding/NewsFragment.java
index c2362a130a..a8b2208f79 100644
--- a/android/src/com/mapswithme/maps/onboarding/NewsFragment.java
+++ b/android/src/com/mapswithme/maps/onboarding/NewsFragment.java
@@ -27,7 +27,6 @@ import com.mapswithme.util.Counters;
import com.mapswithme.util.SharedPropertiesUtils;
import com.mapswithme.util.UTM;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import static com.mapswithme.maps.purchase.BookmarksAllSubscriptionPage.BOOKMARKS;
import static com.mapswithme.maps.purchase.BookmarksAllSubscriptionPage.ELEVATION;
@@ -92,7 +91,6 @@ public class NewsFragment extends BaseNewsFragment implements AlertDialogCallbac
UiUtils.hide(view);
BookmarksAllSubscriptionActivity.startForResult(NewsFragment.this,
PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION,
- Statistics.ParamValue.WHATSNEW,
new BookmarkAllSubscriptionData(LONELY,
GUIDES,
BOOKMARKS,
diff --git a/android/src/com/mapswithme/maps/onboarding/WelcomeDialogFragment.java b/android/src/com/mapswithme/maps/onboarding/WelcomeDialogFragment.java
index db6d416eed..e896aedd51 100644
--- a/android/src/com/mapswithme/maps/onboarding/WelcomeDialogFragment.java
+++ b/android/src/com/mapswithme/maps/onboarding/WelcomeDialogFragment.java
@@ -9,7 +9,6 @@ import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.widget.CheckBox;
-import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
@@ -27,7 +26,6 @@ import com.mapswithme.util.Counters;
import com.mapswithme.util.SharedPropertiesUtils;
import com.mapswithme.util.ThemeUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Arrays;
import java.util.List;
@@ -37,7 +35,6 @@ public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View
{
private static final String ARG_SPECIFIC_STEP = "arg_specific_step";
private static final String ARG_HAS_MANY_STEPS = "arg_has_many_steps";
- private static final String DEF_STATISTICS_VALUE = "agreement";
@NonNull
private final Stack mOnboardingSteps = new Stack<>();
@@ -191,8 +188,6 @@ public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View
initUserAgreementViews();
bindWelcomeScreenType();
- if (savedInstanceState == null)
- trackStatisticEvent(Statistics.EventName.ONBOARDING_SCREEN_SHOW);
return res;
}
@@ -273,8 +268,6 @@ public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View
if (!isAgreementGranted)
return;
- trackStatisticEvent(Statistics.EventName.ONBOARDING_SCREEN_ACCEPT);
-
if (mPolicyAgreementListener != null)
mPolicyAgreementListener.onPolicyAgreementApplied();
dismissAllowingStateLoss();
@@ -309,26 +302,15 @@ public class WelcomeDialogFragment extends BaseMwmDialogFragment implements View
private void onDeclineBtnClicked()
{
Counters.setFirstStartDialogSeen(requireContext());
- trackStatisticEvent(Statistics.EventName.ONBOARDING_SCREEN_DECLINE);
dismissAllowingStateLoss();
}
- private void trackStatisticEvent(@NonNull String event)
- {
- String value = mOnboardinStep == null ? DEF_STATISTICS_VALUE : mOnboardinStep.toStatisticValue();
- Statistics.ParameterBuilder builder = Statistics
- .params().add(Statistics.EventParam.TYPE, value);
- Statistics.INSTANCE.trackEvent(event, builder);
- }
-
@Override
public void onClick(View v)
{
if (v.getId() != R.id.accept_btn)
return;
- trackStatisticEvent(Statistics.EventName.ONBOARDING_SCREEN_ACCEPT);
-
if (!mOnboardingSteps.isEmpty())
{
mOnboardinStep = mOnboardingSteps.pop();
diff --git a/android/src/com/mapswithme/maps/permissions/PermissionsDialogFragment.java b/android/src/com/mapswithme/maps/permissions/PermissionsDialogFragment.java
index 5227d75061..cfd35065a1 100644
--- a/android/src/com/mapswithme/maps/permissions/PermissionsDialogFragment.java
+++ b/android/src/com/mapswithme/maps/permissions/PermissionsDialogFragment.java
@@ -18,7 +18,6 @@ import androidx.fragment.app.FragmentManager;
import com.mapswithme.maps.R;
import com.mapswithme.maps.news.OnboardingStep;
-import com.mapswithme.util.statistics.Statistics;
public class PermissionsDialogFragment extends BasePermissionsDialogFragment
{
@@ -77,7 +76,6 @@ public class PermissionsDialogFragment extends BasePermissionsDialogFragment
protected void onFirstActionClick()
{
PermissionsDetailDialogFragment.show(getActivity(), getRequestCode());
- sendStatistics(Statistics.EventName.ONBOARDING_SCREEN_DECLINE);
}
@IdRes
@@ -87,17 +85,6 @@ public class PermissionsDialogFragment extends BasePermissionsDialogFragment
return R.id.accept_btn;
}
- @NonNull
- @Override
- public Dialog onCreateDialog(Bundle savedInstanceState)
- {
- Dialog dialog = super.onCreateDialog(savedInstanceState);
- if (savedInstanceState == null)
- sendStatistics(Statistics.EventName.ONBOARDING_SCREEN_SHOW);
-
- return dialog;
- }
-
@Override
public void dismiss()
{
@@ -113,18 +100,4 @@ public class PermissionsDialogFragment extends BasePermissionsDialogFragment
super.onCancel(dialog);
getActivity().finish();
}
-
- @Override
- protected void onContinueBtnClicked(View v)
- {
- super.onContinueBtnClicked(v);
- sendStatistics(Statistics.EventName.ONBOARDING_SCREEN_ACCEPT);
- }
-
- private void sendStatistics(@NonNull String event)
- {
- String value = OnboardingStep.PERMISSION_EXPLANATION.toStatisticValue();
- Statistics.ParameterBuilder builder = Statistics.params().add(Statistics.EventParam.TYPE, value);
- Statistics.INSTANCE.trackEvent(event, builder);
- }
}
diff --git a/android/src/com/mapswithme/maps/promo/CatalogPromoController.java b/android/src/com/mapswithme/maps/promo/CatalogPromoController.java
index 18513f34b0..ab5597fa30 100644
--- a/android/src/com/mapswithme/maps/promo/CatalogPromoController.java
+++ b/android/src/com/mapswithme/maps/promo/CatalogPromoController.java
@@ -13,7 +13,6 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.bumptech.glide.Glide;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.Detachable;
import com.mapswithme.maps.bookmarks.BookmarkCategoriesActivity;
@@ -29,11 +28,6 @@ import com.mapswithme.maps.widget.recycler.ItemDecoratorFactory;
import com.mapswithme.util.NetworkPolicy;
import com.mapswithme.util.UTM;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Destination;
-import com.mapswithme.util.statistics.GalleryPlacement;
-import com.mapswithme.util.statistics.GalleryState;
-import com.mapswithme.util.statistics.GalleryType;
-import com.mapswithme.util.statistics.Statistics;
public class CatalogPromoController implements Promo.Listener, Detachable
{
@@ -83,28 +77,6 @@ public class CatalogPromoController implements Promo.Listener, Detachable onCtaClicked(placement, item.getUrl()));
+ cta.setOnClickListener(v -> onCtaClicked(item.getUrl()));
PromoCityGallery.Place place = item.getPlace();
@@ -288,19 +259,15 @@ public class CatalogPromoController implements Promo.Listener, Detachable onMoreDescriptionClicked(item.getUrl()));
-
- Statistics.INSTANCE.trackGalleryShown(GalleryType.PROMO, GalleryState.ONLINE, placement, 1);
}
- private void onCtaClicked(@NonNull GalleryPlacement placement, @NonNull String url)
+ private void onCtaClicked(@NonNull String url)
{
String utmContentUrl = BookmarkManager.INSTANCE.injectCatalogUTMContent(url,
UTM.UTM_CONTENT_VIEW);
BookmarksCatalogActivity.startForResult(requireActivity(),
BookmarkCategoriesActivity.REQ_CODE_DOWNLOAD_BOOKMARK_CATEGORY,
utmContentUrl);
- Statistics.INSTANCE.trackGalleryProductItemSelected(GalleryType.PROMO, placement, 0,
- Destination.CATALOGUE);
}
private void onMoreDescriptionClicked(@NonNull String url)
@@ -349,11 +316,8 @@ public class CatalogPromoController implements Promo.Listener, Detachable implements BookmarkManager.BookmarksCatalogPingListener
@@ -518,7 +471,6 @@ abstract class AbstractBookmarkSubscriptionFragment extends BaseAuthFragment
@Override
public void onPaymentFailure(int error)
{
- Statistics.INSTANCE.trackPurchaseStoreError(mType.getServerId(), error);
activateStateSafely(BookmarkSubscriptionPaymentState.PAYMENT_FAILURE);
}
@@ -537,8 +489,6 @@ abstract class AbstractBookmarkSubscriptionFragment extends BaseAuthFragment
@Override
public void onValidationStarted()
{
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_STORE_SUCCESS,
- mType.getServerId());
activateStateSafely(BookmarkSubscriptionPaymentState.VALIDATION);
}
diff --git a/android/src/com/mapswithme/maps/purchase/AbstractBookmarkValidationCallback.java b/android/src/com/mapswithme/maps/purchase/AbstractBookmarkValidationCallback.java
index a51dcfb245..5245af24b2 100644
--- a/android/src/com/mapswithme/maps/purchase/AbstractBookmarkValidationCallback.java
+++ b/android/src/com/mapswithme/maps/purchase/AbstractBookmarkValidationCallback.java
@@ -5,7 +5,6 @@ import androidx.annotation.Nullable;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
abstract class AbstractBookmarkValidationCallback implements ValidationCallback
{
@@ -26,9 +25,6 @@ abstract class AbstractBookmarkValidationCallback implements ValidationCallback
LOGGER.i(TAG, "Validation status of 'paid bookmark': " + status);
if (status == ValidationStatus.VERIFIED)
{
- //noinspection ConstantConditions
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_VALIDATION_SUCCESS,
- mServerId);
consumePurchase(purchaseData);
return;
}
@@ -37,8 +33,6 @@ abstract class AbstractBookmarkValidationCallback implements ValidationCallback
if (status == ValidationStatus.NOT_VERIFIED)
consumePurchase(purchaseData);
- //noinspection ConstantConditions
- Statistics.INSTANCE.trackPurchaseValidationError(mServerId, status);
onValidationError(status);
}
diff --git a/android/src/com/mapswithme/maps/purchase/AdsRemovalPaymentState.java b/android/src/com/mapswithme/maps/purchase/AdsRemovalPaymentState.java
index 332f785c0c..5a5cda799c 100644
--- a/android/src/com/mapswithme/maps/purchase/AdsRemovalPaymentState.java
+++ b/android/src/com/mapswithme/maps/purchase/AdsRemovalPaymentState.java
@@ -10,7 +10,6 @@ import android.widget.TextView;
import com.mapswithme.maps.PrivateVariables;
import com.mapswithme.maps.R;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
enum AdsRemovalPaymentState
{
@@ -50,9 +49,6 @@ enum AdsRemovalPaymentState
View image = view.findViewById(R.id.image);
alignPayButtonBelow(view, image == null ? R.id.title : R.id.image);
dialog.updatePaymentButtons();
- Statistics.INSTANCE.trackPurchasePreviewShow(SubscriptionType.ADS_REMOVAL.getServerId(),
- SubscriptionType.ADS_REMOVAL.getVendor(),
- SubscriptionType.ADS_REMOVAL.getYearlyProductId());
}
},
EXPLANATION
diff --git a/android/src/com/mapswithme/maps/purchase/AdsRemovalPurchaseDialog.java b/android/src/com/mapswithme/maps/purchase/AdsRemovalPurchaseDialog.java
index 55bdd45049..1c6e8f4972 100644
--- a/android/src/com/mapswithme/maps/purchase/AdsRemovalPurchaseDialog.java
+++ b/android/src/com/mapswithme/maps/purchase/AdsRemovalPurchaseDialog.java
@@ -27,7 +27,6 @@ import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.Collections;
@@ -203,10 +202,6 @@ public class AdsRemovalPurchaseDialog extends BaseMwmDialogFragment
{
ProductDetails details = getProductDetailsForPeriod(period);
getControllerOrThrow().launchPurchaseFlow(details.getProductId());
- String purchaseId = SubscriptionType.ADS_REMOVAL.getServerId();
- Statistics.INSTANCE.trackPurchasePreviewSelect(purchaseId, details.getProductId());
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_PREVIEW_PAY,
- purchaseId, Statistics.STATISTICS_CHANNEL_REALTIME);
}
void onExplanationClick()
@@ -249,14 +244,6 @@ public class AdsRemovalPurchaseDialog extends BaseMwmDialogFragment
outState.putBoolean(EXTRA_ACTIVATION_RESULT, mActivationResult);
}
- @Override
- public void onCancel(DialogInterface dialog)
- {
- super.onCancel(dialog);
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_PREVIEW_CANCEL,
- SubscriptionType.ADS_REMOVAL.getServerId());
- }
-
@Override
public void onDetach()
{
@@ -406,7 +393,6 @@ public class AdsRemovalPurchaseDialog extends BaseMwmDialogFragment
@Override
public void onPaymentFailure(@BillingClient.BillingResponse int error)
{
- Statistics.INSTANCE.trackPurchaseStoreError(SubscriptionType.ADS_REMOVAL.getServerId(), error);
activateStateSafely(AdsRemovalPaymentState.PAYMENT_FAILURE);
}
@@ -425,8 +411,6 @@ public class AdsRemovalPurchaseDialog extends BaseMwmDialogFragment
@Override
public void onValidationStarted()
{
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_STORE_SUCCESS,
- SubscriptionType.ADS_REMOVAL.getServerId());
activateStateSafely(AdsRemovalPaymentState.VALIDATION);
}
diff --git a/android/src/com/mapswithme/maps/purchase/BookmarkPaymentFragment.java b/android/src/com/mapswithme/maps/purchase/BookmarkPaymentFragment.java
index 6c57a311cd..95548a953e 100644
--- a/android/src/com/mapswithme/maps/purchase/BookmarkPaymentFragment.java
+++ b/android/src/com/mapswithme/maps/purchase/BookmarkPaymentFragment.java
@@ -24,7 +24,6 @@ import com.mapswithme.maps.dialog.AlertDialogCallback;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Collections;
import java.util.List;
@@ -114,12 +113,12 @@ public class BookmarkPaymentFragment extends BaseMwmFragment
if (type.equals(SubscriptionType.BOOKMARKS_SIGHTS))
{
BookmarksSightsSubscriptionActivity.startForResult
- (this, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION, Statistics.ParamValue.CARD);
+ (this, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
return;
}
BookmarksAllSubscriptionActivity.startForResult
- (this, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION, Statistics.ParamValue.CARD);
+ (this, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
}
@Override
@@ -140,11 +139,6 @@ public class BookmarkPaymentFragment extends BaseMwmFragment
private void onBuyInappClicked()
{
- Statistics.INSTANCE.trackPurchasePreviewSelect(mPaymentData.getServerId(),
- mPaymentData.getProductId());
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_PREVIEW_PAY,
- mPaymentData.getServerId(),
- Statistics.STATISTICS_CHANNEL_REALTIME);
startPurchaseTransaction();
}
@@ -158,8 +152,6 @@ public class BookmarkPaymentFragment extends BaseMwmFragment
return true;
}
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_PREVIEW_CANCEL,
- mPaymentData.getServerId());
return super.onBackPressed();
}
@@ -167,10 +159,6 @@ public class BookmarkPaymentFragment extends BaseMwmFragment
public void onViewCreated(View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
- if (savedInstanceState == null)
- Statistics.INSTANCE.trackPurchasePreviewShow(mPaymentData.getServerId(),
- PrivateVariables.bookmarksVendor(),
- mPaymentData.getProductId());
LOGGER.d(TAG, "onViewCreated savedInstanceState = " + savedInstanceState);
setInitialPaymentData();
loadImage();
diff --git a/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseCallback.java b/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseCallback.java
index a1947e816f..c0e009e77f 100644
--- a/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseCallback.java
+++ b/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseCallback.java
@@ -6,7 +6,6 @@ import androidx.annotation.Nullable;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.SkuDetails;
import com.mapswithme.maps.base.Detachable;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Collections;
import java.util.List;
@@ -70,8 +69,6 @@ class BookmarkPurchaseCallback
@Override
public void onValidationStarted()
{
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_STORE_SUCCESS,
- mServerId);
activateStateSafely(BookmarkPaymentState.VALIDATION);
}
diff --git a/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseController.java b/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseController.java
index 471736a2db..65d6495b0f 100644
--- a/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseController.java
+++ b/android/src/com/mapswithme/maps/purchase/BookmarkPurchaseController.java
@@ -10,7 +10,6 @@ import com.mapswithme.maps.PrivateVariables;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -74,14 +73,6 @@ class BookmarkPurchaseController extends AbstractPurchaseController details)
{
diff --git a/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionActivity.java b/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionActivity.java
index e22b4d3581..5380ff8bb0 100644
--- a/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionActivity.java
+++ b/android/src/com/mapswithme/maps/purchase/BookmarkSubscriptionActivity.java
@@ -6,15 +6,12 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
-import com.mapswithme.util.statistics.Statistics;
public class BookmarkSubscriptionActivity extends BaseMwmFragmentActivity
{
public static void startForResult(@NonNull FragmentActivity activity)
{
- Intent intent = new Intent(activity, BookmarkSubscriptionActivity.class)
- .putExtra(BookmarkSubscriptionFragment.EXTRA_FROM,
- Statistics.ParamValue.SPONSORED_BUTTON);
+ Intent intent = new Intent(activity, BookmarkSubscriptionActivity.class);
activity.startActivityForResult(intent, PurchaseUtils.REQ_CODE_PAY_SUBSCRIPTION);
}
diff --git a/android/src/com/mapswithme/maps/purchase/BookmarksAllSubscriptionActivity.java b/android/src/com/mapswithme/maps/purchase/BookmarksAllSubscriptionActivity.java
index a122de2b7b..3e76255991 100644
--- a/android/src/com/mapswithme/maps/purchase/BookmarksAllSubscriptionActivity.java
+++ b/android/src/com/mapswithme/maps/purchase/BookmarksAllSubscriptionActivity.java
@@ -34,22 +34,18 @@ public class BookmarksAllSubscriptionActivity extends BaseMwmFragmentActivity
return R.style.MwmTheme;
}
- public static void startForResult(@NonNull Fragment fragment, int requestCode,
- @NonNull String from)
+ public static void startForResult(@NonNull Fragment fragment, int requestCode)
{
Intent intent = new Intent(fragment.getActivity(), BookmarksAllSubscriptionActivity.class);
- intent.putExtra(AbstractBookmarkSubscriptionFragment.EXTRA_FROM, from)
- .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
addBookmarkAllSubscriptionExtra(intent);
fragment.startActivityForResult(intent, requestCode);
}
- public static void startForResult(@NonNull Fragment fragment, int requestCode,
- @NonNull String from, @NonNull BookmarkAllSubscriptionData data)
+ public static void startForResult(@NonNull Fragment fragment, int requestCode, @NonNull BookmarkAllSubscriptionData data)
{
Intent intent = new Intent(fragment.getActivity(), BookmarksAllSubscriptionActivity.class);
- intent.putExtra(AbstractBookmarkSubscriptionFragment.EXTRA_FROM, from)
- .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(BookmarksAllSubscriptionFragment.BUNDLE_DATA, data);
fragment.startActivityForResult(intent, requestCode);
}
diff --git a/android/src/com/mapswithme/maps/purchase/BookmarksSightsSubscriptionActivity.java b/android/src/com/mapswithme/maps/purchase/BookmarksSightsSubscriptionActivity.java
index 74e9557081..f8b17ccf9b 100644
--- a/android/src/com/mapswithme/maps/purchase/BookmarksSightsSubscriptionActivity.java
+++ b/android/src/com/mapswithme/maps/purchase/BookmarksSightsSubscriptionActivity.java
@@ -28,12 +28,10 @@ public class BookmarksSightsSubscriptionActivity extends BaseMwmFragmentActivity
return R.style.MwmTheme;
}
- public static void startForResult(@NonNull Fragment fragment, int requestCode,
- @NonNull String from)
+ public static void startForResult(@NonNull Fragment fragment, int requestCode)
{
Intent intent = new Intent(fragment.getActivity(), BookmarksSightsSubscriptionActivity.class);
- intent.putExtra(AbstractBookmarkSubscriptionFragment.EXTRA_FROM, from)
- .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
fragment.startActivityForResult(intent, requestCode);
}
}
diff --git a/android/src/com/mapswithme/maps/purchase/SubscriptionFragmentDelegate.java b/android/src/com/mapswithme/maps/purchase/SubscriptionFragmentDelegate.java
index 6ce3080e64..45cca69bbf 100644
--- a/android/src/com/mapswithme/maps/purchase/SubscriptionFragmentDelegate.java
+++ b/android/src/com/mapswithme/maps/purchase/SubscriptionFragmentDelegate.java
@@ -7,7 +7,6 @@ import androidx.annotation.NonNull;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
abstract class SubscriptionFragmentDelegate
{
@@ -56,8 +55,6 @@ abstract class SubscriptionFragmentDelegate
private void openSubscriptionManagementSettings()
{
Utils.openUrl(mFragment.requireContext(), "https://play.google.com/store/account/subscriptions");
- Statistics.INSTANCE.trackPurchaseEvent(Statistics.EventName.INAPP_PURCHASE_PREVIEW_RESTORE,
- mFragment.getSubscriptionType().getServerId());
}
private void openTermsOfUseLink()
diff --git a/android/src/com/mapswithme/maps/purchase/SubscriptionPurchaseController.java b/android/src/com/mapswithme/maps/purchase/SubscriptionPurchaseController.java
index e0da2973ab..0b23a895ff 100644
--- a/android/src/com/mapswithme/maps/purchase/SubscriptionPurchaseController.java
+++ b/android/src/com/mapswithme/maps/purchase/SubscriptionPurchaseController.java
@@ -9,7 +9,6 @@ import com.mapswithme.maps.Framework;
import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -55,20 +54,11 @@ class SubscriptionPurchaseController extends AbstractPurchaseController parent.startActivity(new Intent(parent, SettingsActivity.class)));
break;
case TTS_VOLUME:
@@ -197,7 +191,6 @@ public class NavigationController implements Application.ActivityLifecycleCallba
// TrafficManager.INSTANCE.toggle();
// parent.onTrafficLayerSelected();
// mNavMenu.refreshTraffic();
-// //TODO: Add statistics reporting (in separate task)
// break;
case TOGGLE:
mNavMenu.toggle(true);
@@ -533,8 +526,6 @@ public class NavigationController implements Application.ActivityLifecycleCallba
{
case R.id.btn_bookmarks:
BookmarkCategoriesActivity.start(mFrame.getContext());
- Statistics.INSTANCE.trackRoutingEvent(ROUTING_BOOKMARKS_CLICK,
- RoutingController.get().isPlanning());
break;
}
}
diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java
index c9dc6f5e7e..f8f57e9d23 100644
--- a/android/src/com/mapswithme/maps/routing/RoutingController.java
+++ b/android/src/com/mapswithme/maps/routing/RoutingController.java
@@ -34,14 +34,10 @@ import com.mapswithme.util.Utils;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Calendar;
import java.util.concurrent.TimeUnit;
-import static com.mapswithme.util.statistics.Statistics.EventName.ROUTING_POINT_ADD;
-import static com.mapswithme.util.statistics.Statistics.EventName.ROUTING_POINT_REMOVE;
@androidx.annotation.UiThread
public class RoutingController implements TaxiManager.TaxiListener, Initializable
@@ -357,8 +353,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
updatePlan();
- Statistics.INSTANCE.trackRouteBuild(mLastRouterType, getStartPoint(), getEndPoint());
-
Framework.nativeBuildRoute();
}
@@ -515,27 +509,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
build();
}
});
-
- if (startPoint != null)
- trackPointAdd(startPoint, RoutePointInfo.ROUTE_MARK_START, false, false, fromApi);
- if (endPoint != null)
- trackPointAdd(endPoint, RoutePointInfo.ROUTE_MARK_FINISH, false, false, fromApi);
- }
-
- private static void trackPointAdd(@NonNull MapObject point, @RoutePointInfo.RouteMarkType int type,
- boolean isPlanning, boolean isNavigating, boolean fromApi)
- {
- boolean isMyPosition = point.getMapObjectType() == MapObject.MY_POSITION;
- Statistics.INSTANCE.trackRoutingPoint(ROUTING_POINT_ADD, type, isPlanning, isNavigating,
- isMyPosition, fromApi);
- }
-
- private static void trackPointRemove(@NonNull MapObject point, @RoutePointInfo.RouteMarkType int type,
- boolean isPlanning, boolean isNavigating, boolean fromApi)
- {
- boolean isMyPosition = point.getMapObjectType() == MapObject.MY_POSITION;
- Statistics.INSTANCE.trackRoutingPoint(ROUTING_POINT_REMOVE, type, isPlanning, isNavigating,
- isMyPosition, fromApi);
}
public void start()
@@ -550,8 +523,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
if (my == null || !MapObject.isOfType(MapObject.MY_POSITION, getStartPoint()))
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_START_SUGGEST_REBUILD);
- AlohaHelper.logClick(AlohaHelper.ROUTING_START_SUGGEST_REBUILD);
suggestRebuildRoute();
return;
}
@@ -572,8 +543,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
public void addStop(@NonNull MapObject mapObject)
{
addRoutePoint(RoutePointInfo.ROUTE_MARK_INTERMEDIATE, mapObject);
- trackPointAdd(mapObject, RoutePointInfo.ROUTE_MARK_INTERMEDIATE, isPlanning(), isNavigating(),
- false);
build();
if (mContainer != null)
mContainer.onAddedStop();
@@ -588,7 +557,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
applyRemovingIntermediatePointsTransaction();
Framework.nativeRemoveRoutePoint(info.mMarkType, info.mIntermediateIndex);
- trackPointRemove(mapObject, info.mMarkType, isPlanning(), isNavigating(), false);
build();
if (mContainer != null)
mContainer.onRemovedStop();
@@ -946,9 +914,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
startPoint = point;
setPointsInternal(startPoint, endPoint);
checkAndBuildRoute();
- if (startPoint != null)
- trackPointAdd(startPoint, RoutePointInfo.ROUTE_MARK_START, isPlanning(), isNavigating(),
- false);
return true;
}
@@ -997,11 +962,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
}
endPoint = point;
-
- if (endPoint != null)
- trackPointAdd(endPoint, RoutePointInfo.ROUTE_MARK_FINISH, isPlanning(), isNavigating(),
- false);
-
setPointsInternal(startPoint, endPoint);
checkAndBuildRoute();
return true;
@@ -1053,9 +1013,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
startPoint = endPoint;
endPoint = point;
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_SWAP_POINTS);
- AlohaHelper.logClick(AlohaHelper.ROUTING_SWAP_POINTS);
-
setPointsInternal(startPoint, endPoint);
checkAndBuildRoute();
if (mContainer != null)
@@ -1194,8 +1151,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
{
mContainer.onTaxiInfoReceived(provider);
completeTaxiRequest();
- Statistics.INSTANCE.trackTaxiEvent(Statistics.EventName.ROUTING_TAXI_ROUTE_BUILT,
- provider.getType().getProviderName());
}
}
@@ -1208,7 +1163,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
{
mContainer.onTaxiError(error.getCode());
completeTaxiRequest();
- Statistics.INSTANCE.trackTaxiError(error.getTaxiType(), error.getCode());
}
}
@@ -1221,7 +1175,6 @@ public class RoutingController implements TaxiManager.TaxiListener, Initializabl
{
mContainer.onTaxiError(TaxiManager.ErrorCode.NoProviders);
completeTaxiRequest();
- Statistics.INSTANCE.trackTaxiError(null, TaxiManager.ErrorCode.NoProviders);
}
}
}
diff --git a/android/src/com/mapswithme/maps/routing/RoutingPlanController.java b/android/src/com/mapswithme/maps/routing/RoutingPlanController.java
index 535f6be0df..91aebcc8dc 100644
--- a/android/src/com/mapswithme/maps/routing/RoutingPlanController.java
+++ b/android/src/com/mapswithme/maps/routing/RoutingPlanController.java
@@ -23,8 +23,6 @@ import com.mapswithme.maps.widget.RoutingToolbarButton;
import com.mapswithme.maps.widget.ToolbarController;
import com.mapswithme.maps.widget.WheelProgressView;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
public class RoutingPlanController extends ToolbarController
{
@@ -63,18 +61,13 @@ public class RoutingPlanController extends ToolbarController
private RadioButton setupRouterButton(@IdRes int buttonId, final @DrawableRes int iconRes, View.OnClickListener clickListener)
{
- CompoundButton.OnCheckedChangeListener listener = new CompoundButton.OnCheckedChangeListener()
- {
- @Override
- public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
- {
- RoutingToolbarButton button = (RoutingToolbarButton) buttonView;
- button.setIcon(iconRes);
- if (isChecked)
- button.activate();
- else
- button.deactivate();
- }
+ CompoundButton.OnCheckedChangeListener listener = (buttonView, isChecked) -> {
+ RoutingToolbarButton button = (RoutingToolbarButton) buttonView;
+ button.setIcon(iconRes);
+ if (isChecked)
+ button.activate();
+ else
+ button.deactivate();
};
RoutingToolbarButton rb = (RoutingToolbarButton) mRouterTypes.findViewById(buttonId);
@@ -138,44 +131,32 @@ public class RoutingPlanController extends ToolbarController
private void onTransitModeSelected()
{
- AlohaHelper.logClick(AlohaHelper.ROUTING_TRANSIT_SET);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_TRANSIT_SET);
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_TRANSIT);
}
private void onTaxiModeSelected(@NonNull View v)
{
- AlohaHelper.logClick(AlohaHelper.ROUTING_TAXI_SET);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_TAXI_SET);
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_TAXI);
}
private void onBicycleModeSelected(@NonNull View v)
{
- AlohaHelper.logClick(AlohaHelper.ROUTING_BICYCLE_SET);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_BICYCLE_SET);
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_BICYCLE);
}
private void onPedestrianModeSelected(@NonNull View v)
{
- AlohaHelper.logClick(AlohaHelper.ROUTING_PEDESTRIAN_SET);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_PEDESTRIAN_SET);
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_PEDESTRIAN);
}
private void onVehicleModeSelected(@NonNull View v)
{
- AlohaHelper.logClick(AlohaHelper.ROUTING_VEHICLE_SET);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_VEHICLE_SET);
RoutingController.get().setRouterType(Framework.ROUTER_TYPE_VEHICLE);
}
@Override
public void onUpClick()
{
- AlohaHelper.logClick(AlohaHelper.ROUTING_CANCEL);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.ROUTING_CANCEL);
RoutingController.get().cancel();
}
diff --git a/android/src/com/mapswithme/maps/routing/SearchWheel.java b/android/src/com/mapswithme/maps/routing/SearchWheel.java
index b1cebd6daa..1bf2379fdc 100644
--- a/android/src/com/mapswithme/maps/routing/SearchWheel.java
+++ b/android/src/com/mapswithme/maps/routing/SearchWheel.java
@@ -21,9 +21,7 @@ import com.mapswithme.maps.search.SearchEngine;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.concurrency.UiThread;
-import com.mapswithme.util.statistics.Statistics;
-import static com.mapswithme.util.statistics.Statistics.EventName.ROUTING_SEARCH_CLICK;
class SearchWheel implements View.OnClickListener
{
@@ -113,14 +111,9 @@ class SearchWheel implements View.OnClickListener
mSearchLayout = mFrame.findViewById(R.id.search_frame);
if (UiUtils.isLandscape(mFrame.getContext()))
{
- UiUtils.waitLayout(mSearchLayout, new ViewTreeObserver.OnGlobalLayoutListener()
- {
- @Override
- public void onGlobalLayout()
- {
- mSearchLayout.setPivotX(0);
- mSearchLayout.setPivotY(mSearchLayout.getMeasuredHeight() / 2);
- }
+ UiUtils.waitLayout(mSearchLayout, () -> {
+ mSearchLayout.setPivotX(0);
+ mSearchLayout.setPivotY(mSearchLayout.getMeasuredHeight() / 2);
});
}
for (SearchOption searchOption : SearchOption.values())
@@ -235,18 +228,12 @@ class SearchWheel implements View.OnClickListener
if (RoutingController.get().isPlanning())
{
if (TextUtils.isEmpty(SearchEngine.INSTANCE.getQuery()))
- {
showSearchInParent();
- Statistics.INSTANCE.trackRoutingEvent(ROUTING_SEARCH_CLICK, true);
- }
else
- {
reset();
- }
return;
}
- Statistics.INSTANCE.trackRoutingEvent(ROUTING_SEARCH_CLICK, false);
if (mCurrentOption != null || !TextUtils.isEmpty(SearchEngine.INSTANCE.getQuery()))
{
SearchEngine.INSTANCE.cancelInteractiveSearch();
diff --git a/android/src/com/mapswithme/maps/search/CategoriesAdapter.java b/android/src/com/mapswithme/maps/search/CategoriesAdapter.java
index c4bf79a37b..d4f835ee01 100644
--- a/android/src/com/mapswithme/maps/search/CategoriesAdapter.java
+++ b/android/src/com/mapswithme/maps/search/CategoriesAdapter.java
@@ -13,18 +13,13 @@ import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.ActionMenuView;
-import android.widget.ImageView;
import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.util.ThemeUtils;
-import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.util.List;
class CategoriesAdapter extends RecyclerView.Adapter
{
@@ -186,7 +181,6 @@ class CategoriesAdapter extends RecyclerView.Adapter
- {
- Statistics.INSTANCE.trackFilterEvent(Statistics.EventName.SEARCH_FILTER_RESET,
- Statistics.EventParam.HOTEL);
- updateViews(null, null);
- });
+ .setOnClickListener(v -> updateViews(null));
}
@Nullable
@@ -169,7 +146,7 @@ public class FilterFragment extends BaseMwmToolbarFragment
return combineFilters(rating, price, oneOf);
}
- private void updateViews(@Nullable HotelsFilter filter, @Nullable BookingFilterParams params)
+ private void updateViews(@Nullable HotelsFilter filter)
{
if (filter == null)
{
@@ -207,15 +184,9 @@ public class FilterFragment extends BaseMwmToolbarFragment
public void onTypeSelected(boolean selected, @NonNull HotelsFilter.HotelType type)
{
if (selected)
- {
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.TYPE, type.getTag()));
mHotelTypes.add(type);
- }
else
- {
mHotelTypes.remove(type);
- }
}
interface Listener
diff --git a/android/src/com/mapswithme/maps/search/FilterUtils.java b/android/src/com/mapswithme/maps/search/FilterUtils.java
index 52965131bb..297e3ca407 100644
--- a/android/src/com/mapswithme/maps/search/FilterUtils.java
+++ b/android/src/com/mapswithme/maps/search/FilterUtils.java
@@ -15,7 +15,6 @@ import com.google.android.material.datepicker.MaterialDatePicker;
import com.mapswithme.maps.R;
import com.mapswithme.maps.dialog.AlertDialog;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -384,40 +383,6 @@ public class FilterUtils
return new RoomGuestCounts(roomsCount, adultsCount, childrenCount, infantsCount);
}
- public static void trackFiltersApplying(@Nullable SearchFilterController filterController)
- {
- if (filterController == null)
- return;
-
- HotelsFilter filter = filterController.getFilter();
- BookingFilterParams params = filterController.getBookingFilterParams();
- Statistics.INSTANCE.trackQuickFilterApply(Statistics.EventParam.HOTEL,
- toAppliedFiltersString(filter, params));
- }
-
- @Nullable
- public static String toAppliedFiltersString(@Nullable HotelsFilter filter,
- @Nullable BookingFilterParams params)
- {
- final Map map = new HashMap<>();
- if (filter != null)
- {
- // TODO: parse filter parameters and put their in map here.
- }
-
- if (params != null)
- {
- map.put("date", params.getCheckinMillisec() + "," + params.getCheckoutMillisec());
- RoomGuestCounts counts = toCounts(params.getRooms());
- map.put("rooms", String.valueOf(counts.getRooms()));
- map.put("adults", String.valueOf(counts.getAdults()));
- map.put("children", String.valueOf(counts.getChildren()));
- map.put("infants", String.valueOf(counts.getInfants()));
- }
-
- return map.isEmpty() ? null : map.toString();
- }
-
@Nullable
public static BookingFilterParams createDefaultParams()
{
diff --git a/android/src/com/mapswithme/maps/search/PriceFilterView.java b/android/src/com/mapswithme/maps/search/PriceFilterView.java
index 2f1a11728b..5359eae656 100644
--- a/android/src/com/mapswithme/maps/search/PriceFilterView.java
+++ b/android/src/com/mapswithme/maps/search/PriceFilterView.java
@@ -20,7 +20,6 @@ import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -115,8 +114,9 @@ public class PriceFilterView extends LinearLayout implements View.OnClickListene
}
@Override
- protected void onFinishInflate()
- {
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+
View low = findViewById(R.id.low);
low.setOnClickListener(this);
mItems.append(R.id.low, new Item(low, (TextView) findViewById(R.id.low_title)));
@@ -198,25 +198,6 @@ public class PriceFilterView extends LinearLayout implements View.OnClickListene
@Override
public void onClick(View v)
{
- switch (v.getId())
- {
- case R.id.low:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.PRICE_CATEGORY,
- String.valueOf(LOW)));
- break;
- case R.id.medium:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.PRICE_CATEGORY,
- String.valueOf(MEDIUM)));
- break;
- case R.id.high:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.PRICE_CATEGORY,
- String.valueOf(HIGH)));
- break;
- }
-
select(v.getId(), false);
}
diff --git a/android/src/com/mapswithme/maps/search/RatingFilterView.java b/android/src/com/mapswithme/maps/search/RatingFilterView.java
index fe47f4a259..6fbfb317fd 100644
--- a/android/src/com/mapswithme/maps/search/RatingFilterView.java
+++ b/android/src/com/mapswithme/maps/search/RatingFilterView.java
@@ -18,7 +18,6 @@ import android.widget.TextView;
import com.mapswithme.maps.R;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import static com.mapswithme.maps.search.HotelsFilter.Op.OP_GE;
@@ -152,27 +151,15 @@ public class RatingFilterView extends LinearLayout implements View.OnClickListen
switch (v.getId())
{
case R.id.any:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.RATING,
- Statistics.ParamValue.ANY));
update(null);
break;
case R.id.good:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.RATING,
- String.valueOf(GOOD)));
update(new HotelsFilter.RatingFilter(OP_GE, GOOD));
break;
case R.id.very_good:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.RATING,
- String.valueOf(VERY_GOOD)));
update(new HotelsFilter.RatingFilter(OP_GE, VERY_GOOD));
break;
case R.id.excellent:
- Statistics.INSTANCE.trackFilterClick(Statistics.EventParam.HOTEL,
- new Pair<>(Statistics.EventParam.RATING,
- String.valueOf(EXCELLENT)));
update(new HotelsFilter.RatingFilter(OP_GE, EXCELLENT));
break;
}
diff --git a/android/src/com/mapswithme/maps/search/SearchFragment.java b/android/src/com/mapswithme/maps/search/SearchFragment.java
index 699acb69c2..1ef7b877a1 100644
--- a/android/src/com/mapswithme/maps/search/SearchFragment.java
+++ b/android/src/com/mapswithme/maps/search/SearchFragment.java
@@ -41,7 +41,6 @@ import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.Arrays;
@@ -333,7 +332,6 @@ public class SearchFragment extends BaseMwmFragment
public void onShowOnMapClick()
{
showAllResultsOnMap();
- Statistics.INSTANCE.trackSearchContextAreaClick(Statistics.ParamValue.MAP);
}
@Override
@@ -348,7 +346,6 @@ public class SearchFragment extends BaseMwmFragment
}
FilterActivity.startForResult(SearchFragment.this, filter, params,
FilterActivity.REQ_CODE_FILTER);
- Statistics.INSTANCE.trackSearchContextAreaClick(Statistics.EventParam.FILTER);
}
@Override
@@ -360,7 +357,6 @@ public class SearchFragment extends BaseMwmFragment
@Override
public void onFilterParamsChanged()
{
- FilterUtils.trackFiltersApplying(mFilterController);
runSearch();
}
}, mToolbarController);
@@ -396,11 +392,7 @@ public class SearchFragment extends BaseMwmFragment
if (SearchRecents.getSize() == 0)
pager.setCurrentItem(TabAdapter.Tab.CATEGORIES.ordinal());
- tabAdapter.setTabSelectedListener(tab ->
- {
- Statistics.INSTANCE.trackSearchTabSelected(tab.name());
- mToolbarController.deactivate();
- });
+ tabAdapter.setTabSelectedListener(tab -> mToolbarController.deactivate());
if (mInitialSearchOnMap)
showAllResultsOnMap();
@@ -544,7 +536,6 @@ public class SearchFragment extends BaseMwmFragment
SearchEngine.INSTANCE.setQuery(query);
processSelected(result);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.SEARCH_ITEM_CLICKED);
}
void showAllResultsOnMap()
@@ -573,7 +564,6 @@ public class SearchFragment extends BaseMwmFragment
SearchEngine.INSTANCE.setQuery(query);
Utils.navigateToParent(getActivity());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.SEARCH_ON_MAP_CLICKED);
}
private void onSearchEnd()
@@ -819,8 +809,6 @@ public class SearchFragment extends BaseMwmFragment
@Override
void executeInternal()
{
- Logger logger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.THIRD_PARTY);
- String tag = PushTokenCommand.class.getSimpleName();
}
}
}
diff --git a/android/src/com/mapswithme/maps/settings/AboutFragment.java b/android/src/com/mapswithme/maps/settings/AboutFragment.java
index 4e38d24867..80eddb2e6a 100644
--- a/android/src/com/mapswithme/maps/settings/AboutFragment.java
+++ b/android/src/com/mapswithme/maps/settings/AboutFragment.java
@@ -20,8 +20,6 @@ import com.mapswithme.util.Constants;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.Utils;
import com.mapswithme.util.sharing.ShareOption;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
public class AboutFragment extends BaseSettingsFragment
implements View.OnClickListener
@@ -88,46 +86,33 @@ public class AboutFragment extends BaseSettingsFragment
switch (v.getId())
{
case R.id.web:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.WEB_SITE);
- AlohaHelper.logClick(AlohaHelper.Settings.WEB_SITE);
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.WEB_SITE)));
break;
case R.id.facebook:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.FACEBOOK);
- AlohaHelper.logClick(AlohaHelper.Settings.FACEBOOK);
Utils.showFacebookPage(getActivity());
break;
case R.id.twitter:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.TWITTER);
- AlohaHelper.logClick(AlohaHelper.Settings.TWITTER);
Utils.showTwitterPage(getActivity());
break;
case R.id.rate:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.RATE);
- AlohaHelper.logClick(AlohaHelper.Settings.RATE);
Utils.openAppInMarket(getActivity(), BuildConfig.REVIEW_URL);
break;
case R.id.share:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.TELL_FRIEND);
- AlohaHelper.logClick(AlohaHelper.Settings.TELL_FRIEND);
ShareOption.AnyShareOption.ANY.share(getActivity(), getString(R.string.tell_friends_text),
R.string.tell_friends);
break;
case R.id.copyright:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.COPYRIGHT);
- AlohaHelper.logClick(AlohaHelper.Settings.COPYRIGHT);
getSettingsActivity().replaceFragment(CopyrightFragment.class,
getString(R.string.copyright), null);
break;
}
} catch (ActivityNotFoundException e)
{
- AlohaHelper.logException(e);
}
}
}
diff --git a/android/src/com/mapswithme/maps/settings/DrivingOptionsFragment.java b/android/src/com/mapswithme/maps/settings/DrivingOptionsFragment.java
index afd8b71cdb..589067c80f 100644
--- a/android/src/com/mapswithme/maps/settings/DrivingOptionsFragment.java
+++ b/android/src/com/mapswithme/maps/settings/DrivingOptionsFragment.java
@@ -13,7 +13,6 @@ import android.widget.Switch;
import com.mapswithme.maps.R;
import com.mapswithme.maps.base.BaseMwmToolbarFragment;
import com.mapswithme.maps.routing.RoutingOptions;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.Collections;
@@ -34,10 +33,7 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
@Nullable Bundle savedInstanceState)
{
View root = inflater.inflate(R.layout.fragment_driving_options, container, false);
- String componentDescent = getArguments() == null
- ? Statistics.EventParam.ROUTE
- : getArguments().getString(Statistics.EventParam.FROM, Statistics.EventParam.ROUTE);
- initViews(root, componentDescent);
+ initViews(root);
mRoadTypes = savedInstanceState != null && savedInstanceState.containsKey(BUNDLE_ROAD_TYPES)
? makeRouteTypes(savedInstanceState)
: RoutingOptions.getActiveRoadTypes();
@@ -82,30 +78,30 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
return super.onBackPressed();
}
- private void initViews(@NonNull View root, @NonNull String componentDescent)
+ private void initViews(@NonNull View root)
{
Switch tollsBtn = root.findViewById(R.id.avoid_tolls_btn);
tollsBtn.setChecked(RoutingOptions.hasOption(RoadType.Toll));
CompoundButton.OnCheckedChangeListener tollBtnListener =
- new ToggleRoutingOptionListener(RoadType.Toll, componentDescent);
+ new ToggleRoutingOptionListener(RoadType.Toll);
tollsBtn.setOnCheckedChangeListener(tollBtnListener);
Switch motorwaysBtn = root.findViewById(R.id.avoid_motorways_btn);
motorwaysBtn.setChecked(RoutingOptions.hasOption(RoadType.Motorway));
CompoundButton.OnCheckedChangeListener motorwayBtnListener =
- new ToggleRoutingOptionListener(RoadType.Motorway, componentDescent);
+ new ToggleRoutingOptionListener(RoadType.Motorway);
motorwaysBtn.setOnCheckedChangeListener(motorwayBtnListener);
Switch ferriesBtn = root.findViewById(R.id.avoid_ferries_btn);
ferriesBtn.setChecked(RoutingOptions.hasOption(RoadType.Ferry));
CompoundButton.OnCheckedChangeListener ferryBtnListener =
- new ToggleRoutingOptionListener(RoadType.Ferry, componentDescent);
+ new ToggleRoutingOptionListener(RoadType.Ferry);
ferriesBtn.setOnCheckedChangeListener(ferryBtnListener);
Switch dirtyRoadsBtn = root.findViewById(R.id.avoid_dirty_roads_btn);
dirtyRoadsBtn.setChecked(RoutingOptions.hasOption(RoadType.Dirty));
CompoundButton.OnCheckedChangeListener dirtyBtnListener =
- new ToggleRoutingOptionListener(RoadType.Dirty, componentDescent);
+ new ToggleRoutingOptionListener(RoadType.Dirty);
dirtyRoadsBtn.setOnCheckedChangeListener(dirtyBtnListener);
}
@@ -114,13 +110,9 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
@NonNull
private final RoadType mRoadType;
- @NonNull
- private final String mComponentDescent;
-
- private ToggleRoutingOptionListener(@NonNull RoadType roadType, @NonNull String componentDescent)
+ private ToggleRoutingOptionListener(@NonNull RoadType roadType)
{
mRoadType = roadType;
- mComponentDescent = componentDescent;
}
@Override
@@ -130,8 +122,6 @@ public class DrivingOptionsFragment extends BaseMwmToolbarFragment
RoutingOptions.addOption(mRoadType);
else
RoutingOptions.removeOption(mRoadType);
-
- Statistics.INSTANCE.trackSettingsDrivingOptionsChangeEvent(mComponentDescent);
}
}
}
diff --git a/android/src/com/mapswithme/maps/settings/HelpFragment.java b/android/src/com/mapswithme/maps/settings/HelpFragment.java
index a943d942d4..5d49d7c6cb 100644
--- a/android/src/com/mapswithme/maps/settings/HelpFragment.java
+++ b/android/src/com/mapswithme/maps/settings/HelpFragment.java
@@ -15,25 +15,19 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.WebContainerDelegate;
import com.mapswithme.util.Constants;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
public class HelpFragment extends BaseSettingsFragment
{
@NonNull
- private DialogInterface.OnClickListener mDialogClickListener = new DialogInterface.OnClickListener()
+ private final DialogInterface.OnClickListener mDialogClickListener = new DialogInterface.OnClickListener()
{
private void sendGeneralFeedback()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.FEEDBACK_GENERAL);
- AlohaHelper.logClick(AlohaHelper.Settings.FEEDBACK_GENERAL);
Utils.sendFeedback(requireActivity());
}
private void reportBug()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.REPORT_BUG);
- AlohaHelper.logClick(AlohaHelper.Settings.REPORT_BUG);
Utils.sendBugReport(requireActivity(), "Bugreport from user");
}
@@ -51,7 +45,7 @@ public class HelpFragment extends BaseSettingsFragment
break;
}
}
- };;
+ };
@Override
protected int getLayoutRes()
diff --git a/android/src/com/mapswithme/maps/settings/SettingsPrefsFragment.java b/android/src/com/mapswithme/maps/settings/SettingsPrefsFragment.java
index 16fb0b994d..7240e1ee16 100644
--- a/android/src/com/mapswithme/maps/settings/SettingsPrefsFragment.java
+++ b/android/src/com/mapswithme/maps/settings/SettingsPrefsFragment.java
@@ -50,8 +50,6 @@ import com.mapswithme.util.ThemeSwitcher;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
import java.util.HashMap;
import java.util.List;
@@ -114,7 +112,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
@Override
public boolean onPreferenceChange(Preference preference, Object newValue)
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.VOICE_ENABLED, Statistics.params().add(Statistics.EventParam.ENABLED, newValue.toString()));
Preference root = findPreference(getString(R.string.pref_tts_screen));
boolean set = (Boolean)newValue;
if (!set)
@@ -163,7 +160,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
return false;
mSelectedLanguage = (String)newValue;
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.VOICE_LANGUAGE, Statistics.params().add(Statistics.EventParam.LANGUAGE, mSelectedLanguage));
LanguageData lang = mLanguages.get(mSelectedLanguage);
if (lang == null)
return false;
@@ -285,7 +281,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
private boolean onToggleCrashReports(Object newValue)
{
boolean isEnabled = (boolean) newValue;
- Statistics.INSTANCE.trackSettingsToggle(isEnabled);
FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(isEnabled);
return true;
}
@@ -330,7 +325,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
init3dModePrefsCallbacks();
initPerspectivePrefsCallbacks();
initTrackRecordPrefsCallbacks();
- initStatisticsPrefsCallback();
initPlayServicesPrefsCallbacks();
initAutoZoomPrefsCallbacks();
initLoggingEnabledPrefsCallbacks();
@@ -370,10 +364,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
private void onSpeedCamerasPrefChanged(@NonNull SpeedCameraMode oldCamMode,
@NonNull SpeedCameraMode newCamMode)
{
- Statistics.ParameterBuilder params = new Statistics
- .ParameterBuilder()
- .add(Statistics.EventParam.VALUE, newCamMode.name().toLowerCase());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.SETTINGS_SPEED_CAMS, params);
Framework.setSpeedCamerasMode(newCamMode);
}
@@ -405,19 +395,8 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
@Override
public boolean onPreferenceTreeClick(Preference preference)
{
- if (preference.getKey() != null && preference.getKey().equals(getString(R.string.pref_help)))
+ if (preference.getKey() != null && preference.getKey().equals(getString(R.string.pref_osm_profile)))
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.HELP);
- AlohaHelper.logClick(AlohaHelper.Settings.HELP);
- }
- else if (preference.getKey() != null && preference.getKey().equals(getString(R.string.pref_about)))
- {
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.ABOUT);
- AlohaHelper.logClick(AlohaHelper.Settings.ABOUT);
- }
- else if (preference.getKey() != null && preference.getKey().equals(getString(R.string.pref_osm_profile)))
- {
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.OSM_PROFILE);
startActivity(new Intent(getActivity(), ProfileActivity.class));
}
return super.onPreferenceTreeClick(preference);
@@ -525,8 +504,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
|| type == NetworkPolicy.Type.NEVER)
{
Config.setUseMobileDataSettings(type);
- Statistics.INSTANCE.trackNetworkUsageAlert(Statistics.EventName.SETTINGS_MOBILE_INTERNET_CHANGE,
- type.toStatisticValue());
}
else
{
@@ -564,7 +541,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
int scheme = Integer.parseInt((String) newValue);
PowerManagment.setScheme(scheme);
- Statistics.INSTANCE.trackPowerManagmentSchemeChanged(scheme);
return true;
});
@@ -649,27 +625,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
}
}
- private void initStatisticsPrefsCallback()
- {
- Preference pref = findPreference(getString(R.string.pref_send_statistics));
- if (pref == null)
- return;
-
- ((TwoStatePreference)pref).setChecked(SharedPropertiesUtils.isStatisticsEnabled(requireContext()));
- pref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener()
- {
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue)
- {
- Statistics.INSTANCE.setStatEnabled(requireContext(), (Boolean) newValue);
- return true;
- }
- });
-
- // Sic: temporary disable statistics
- removePreference(getString(R.string.pref_subtittle_opt_out), pref);
- }
-
private void initTrackRecordPrefsCallbacks()
{
final ListPreference trackPref = (ListPreference)findPreference(getString(R.string.pref_track_record));
@@ -691,7 +646,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
{
boolean enabled = (Boolean) newValue;
TrackRecorder.INSTANCE.setEnabled(enabled);
- Statistics.INSTANCE.setStatEnabled(requireContext(), enabled);
trackPref.setEnabled(enabled);
if (root != null)
root.setSummary(enabled ? R.string.on : R.string.off);
@@ -720,9 +674,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
root.setSummary(enabled ? R.string.on : R.string.off);
pref.setTitle(enabled ? R.string.on : R.string.off);
- Statistics.ParameterBuilder builder =
- new Statistics.ParameterBuilder().add(Statistics.EventParam.VALUE, value);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.SETTINGS_RECENT_TRACK_CHANGE, builder);
UiThread.runLater(new Runnable()
{
@Override
@@ -819,7 +770,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
{
Boolean value = (Boolean) newValue;
BookmarkManager.INSTANCE.setCloudEnabled(value);
- Statistics.INSTANCE.trackBmSettingsToggle(value);
return true;
});
}
@@ -843,8 +793,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
return true;
ThemeSwitcher.INSTANCE.restart(false);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.MAP_STYLE,
- Statistics.params().add(Statistics.EventParam.NAME, themeName));
ListPreference mapStyleModeList = (ListPreference) pref;
ThemeMode mode = ThemeMode.getInstance(getContext().getApplicationContext(), themeName);
@@ -865,7 +813,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
@Override
public boolean onPreferenceChange(Preference preference, Object newValue)
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.ZOOM);
Config.setShowZoomButtons((Boolean) newValue);
return true;
}
@@ -885,8 +832,6 @@ public class SettingsPrefsFragment extends BaseXmlSettingsFragment
public boolean onPreferenceChange(Preference preference, Object newValue)
{
UnitLocale.setUnits(Integer.parseInt((String) newValue));
- Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.UNITS);
- AlohaHelper.logClick(AlohaHelper.Settings.CHANGE_UNITS);
return true;
}
});
diff --git a/android/src/com/mapswithme/maps/sound/TtsPlayer.java b/android/src/com/mapswithme/maps/sound/TtsPlayer.java
index ed9400735b..8fe005be05 100644
--- a/android/src/com/mapswithme/maps/sound/TtsPlayer.java
+++ b/android/src/com/mapswithme/maps/sound/TtsPlayer.java
@@ -15,7 +15,6 @@ import com.mapswithme.maps.base.MediaPlayerWrapper;
import com.mapswithme.util.Config;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.List;
@@ -57,13 +56,6 @@ public enum TtsPlayer implements Initializable
TtsPlayer() {}
- private static void reportFailure(IllegalArgumentException e, String location)
- {
- Statistics.INSTANCE.trackEvent(Statistics.EventName.TTS_FAILURE_LOCATION,
- Statistics.params().add(Statistics.EventParam.ERR_MSG, e.getMessage())
- .add(Statistics.EventParam.FROM, location));
- }
-
private static @Nullable LanguageData findSupportedLanguage(String internalCode, List langs)
{
if (TextUtils.isEmpty(internalCode))
@@ -100,7 +92,6 @@ public enum TtsPlayer implements Initializable
}
catch (IllegalArgumentException e)
{
- reportFailure(e, "setLanguageInternal(): " + lang.locale);
lockDown();
return false;
}
@@ -191,7 +182,6 @@ public enum TtsPlayer implements Initializable
}
catch (IllegalArgumentException e)
{
- reportFailure(e, "speak()");
lockDown();
}
}
@@ -227,7 +217,6 @@ public enum TtsPlayer implements Initializable
}
catch (IllegalArgumentException e)
{
- reportFailure(e, "stop()");
lockDown();
}
}
@@ -261,7 +250,6 @@ public enum TtsPlayer implements Initializable
catch (IllegalArgumentException e)
{
LOGGER.e(TAG, "Failed to get usable languages", e);
- reportFailure(e, "getUsableLanguages()");
lockDown();
return false;
}
diff --git a/android/src/com/mapswithme/maps/taxi/TaxiManager.java b/android/src/com/mapswithme/maps/taxi/TaxiManager.java
index 95cbc985a0..8c79eee3ff 100644
--- a/android/src/com/mapswithme/maps/taxi/TaxiManager.java
+++ b/android/src/com/mapswithme/maps/taxi/TaxiManager.java
@@ -13,8 +13,6 @@ import com.mapswithme.util.NetworkPolicy;
import com.mapswithme.util.SponsoredLinks;
import com.mapswithme.util.Utils;
import com.mapswithme.util.concurrency.UiThread;
-import com.mapswithme.util.statistics.StatisticValueConverter;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.Arrays;
@@ -97,17 +95,6 @@ public class TaxiManager
@NonNull TaxiType type)
{
Utils.openPartner(context, links, type.getPackageName(), type.getOpenMode());
-
- boolean isTaxiInstalled = Utils.isAppInstalled(context, type.getPackageName());
- trackTaxiStatistics(type.getProviderName(), isTaxiInstalled);
- }
-
- private static void trackTaxiStatistics(@NonNull String taxiName, boolean isTaxiAppInstalled)
- {
- MapObject from = RoutingController.get().getStartPoint();
- MapObject to = RoutingController.get().getEndPoint();
- Location location = LocationHelper.INSTANCE.getLastKnownLocation();
- Statistics.INSTANCE.trackTaxiInRoutePlanning(from, to, location, taxiName, isTaxiAppInstalled);
}
public void setTaxiListener(@Nullable TaxiListener listener)
@@ -123,35 +110,11 @@ public class TaxiManager
@NonNull String productId, double srcLon,
double srcLat, double dstLat, double dstLon);
- public enum ErrorCode implements StatisticValueConverter
+ public enum ErrorCode
{
- NoProducts
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "No products";
- }
- },
- RemoteError
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "Server error";
- }
- },
+ NoProducts,
+ RemoteError,
NoProviders
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return "No Providers";
- }
- }
}
public interface TaxiListener
diff --git a/android/src/com/mapswithme/maps/tips/TutorialClickListener.java b/android/src/com/mapswithme/maps/tips/TutorialClickListener.java
index 4ac6fa3eff..09571531c4 100644
--- a/android/src/com/mapswithme/maps/tips/TutorialClickListener.java
+++ b/android/src/com/mapswithme/maps/tips/TutorialClickListener.java
@@ -5,7 +5,6 @@ import android.view.View;
import androidx.annotation.NonNull;
import com.mapswithme.maps.MwmActivity;
-import com.mapswithme.util.statistics.Statistics;
public abstract class TutorialClickListener implements View.OnClickListener
{
@@ -33,7 +32,6 @@ public abstract class TutorialClickListener implements View.OnClickListener
MwmActivity mwmActivity = (MwmActivity) mActivity;
ClickInterceptor interceptor = tutorial.createClickInterceptor();
interceptor.onInterceptClick(mwmActivity);
- Statistics.INSTANCE.trackTipsEvent(Statistics.EventName.TIPS_TRICKS_CLICK, tutorial.ordinal());
return;
}
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java b/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
index b68718302a..1bdf77d594 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
@@ -10,13 +10,11 @@ import androidx.fragment.app.Fragment;
import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.maps.metrics.UserActionsLogger;
import com.mapswithme.util.ThemeUtils;
-import com.mapswithme.util.statistics.Statistics;
public class UGCEditorActivity extends BaseMwmFragmentActivity
{
public static void start(@NonNull Activity activity, @NonNull EditParams params)
{
- Statistics.INSTANCE.trackUGCStart(false, params.isFromPP(), params.isFromNotification());
UserActionsLogger.logUgcEditorOpened();
final Intent i = new Intent(activity, UGCEditorActivity.class);
Bundle args = new Bundle();
@@ -48,7 +46,6 @@ public class UGCEditorActivity extends BaseMwmFragmentActivity
@Override
public void onBackPressed()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_REVIEW_CANCEL);
super.onBackPressed();
}
}
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
index 5b3f568e96..7a9f1928db 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
@@ -23,7 +23,6 @@ import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.Language;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
@@ -97,7 +96,6 @@ public class UGCEditorFragment extends BaseToolbarAuthFragment
@Override
public void onUpClick()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_REVIEW_CANCEL);
super.onUpClick();
}
};
@@ -118,7 +116,6 @@ public class UGCEditorFragment extends BaseToolbarAuthFragment
}
UserActionsLogger.logUgcSaved();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_REVIEW_SUCCESS);
if (!ConnectionState.INSTANCE.isConnected())
{
@@ -174,7 +171,6 @@ public class UGCEditorFragment extends BaseToolbarAuthFragment
@Override
public void onSocialAuthenticationCancel(@Framework.AuthTokenType int type)
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_AUTH_DECLINED);
Utils.showSnackbar(requireContext(), root, R.string.ugc_thanks_message_not_auth);
finishActivity();
}
@@ -182,7 +178,6 @@ public class UGCEditorFragment extends BaseToolbarAuthFragment
@Override
public void onSocialAuthenticationError(int type, @Nullable String error)
{
- Statistics.INSTANCE.trackUGCAuthFailed(type, error);
Utils.showSnackbar(requireContext(), root, R.string.ugc_thanks_message_not_auth);
finishActivity();
}
diff --git a/android/src/com/mapswithme/maps/ugc/routes/SendLinkPlaceholderFragment.java b/android/src/com/mapswithme/maps/ugc/routes/SendLinkPlaceholderFragment.java
index 6454c23bc0..96a6cd171d 100644
--- a/android/src/com/mapswithme/maps/ugc/routes/SendLinkPlaceholderFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/routes/SendLinkPlaceholderFragment.java
@@ -19,7 +19,6 @@ import com.mapswithme.maps.bookmarks.data.CatalogTagsGroup;
import com.mapswithme.maps.dialog.AlertDialog;
import com.mapswithme.maps.dialog.AlertDialogCallback;
import com.mapswithme.util.sharing.TargetUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
import java.util.Objects;
@@ -82,7 +81,6 @@ public class SendLinkPlaceholderFragment extends BaseAuthFragment implements Boo
private void shareLink()
{
shareLink(BookmarkManager.INSTANCE.getWebEditorUrl(mCategory.getServerId()), requireActivity());
- Statistics.INSTANCE.trackEvent(Statistics.EventName.BM_EDIT_ON_WEB_CLICK);
}
static void shareLink(@NonNull String url, @NonNull FragmentActivity activity)
diff --git a/android/src/com/mapswithme/maps/ugc/routes/UgcRouteEditSettingsFragment.java b/android/src/com/mapswithme/maps/ugc/routes/UgcRouteEditSettingsFragment.java
index d502a46a03..bc510ede9d 100644
--- a/android/src/com/mapswithme/maps/ugc/routes/UgcRouteEditSettingsFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/routes/UgcRouteEditSettingsFragment.java
@@ -20,7 +20,6 @@ import com.mapswithme.maps.base.BaseMwmToolbarFragment;
import com.mapswithme.maps.bookmarks.data.BookmarkCategory;
import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.maps.dialog.DialogUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Objects;
@@ -94,7 +93,6 @@ public class UgcRouteEditSettingsFragment extends BaseMwmToolbarFragment
private void onSharingOptionsClicked()
{
openSharingOptionsScreen();
- Statistics.INSTANCE.trackEditSettingsSharingOptionsClick();
}
private void openSharingOptionsScreen()
@@ -119,15 +117,6 @@ public class UgcRouteEditSettingsFragment extends BaseMwmToolbarFragment
return super.onOptionsItemSelected(item);
}
- @Override
- public boolean onBackPressed()
- {
- if (isCategoryDescChanged())
- Statistics.INSTANCE.trackCategoryDescChanged();
- Statistics.INSTANCE.trackEditSettingsCancel();
- return super.onBackPressed();
- }
-
private void onEditDoneClicked()
{
final String newCategoryName = getEditableCategoryName();
@@ -138,12 +127,8 @@ public class UgcRouteEditSettingsFragment extends BaseMwmToolbarFragment
BookmarkManager.INSTANCE.setCategoryName(mCategory.getId(), newCategoryName);
if (isCategoryDescChanged())
- {
BookmarkManager.INSTANCE.setCategoryDescription(mCategory.getId(), getEditableCategoryDesc());
- Statistics.INSTANCE.trackCategoryDescChanged();
- }
- Statistics.INSTANCE.trackEditSettingsConfirm();
requireActivity().finish();
}
diff --git a/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java b/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java
index 84eddc3891..0502497a18 100644
--- a/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/routes/UgcSharingOptionsFragment.java
@@ -35,7 +35,6 @@ import com.mapswithme.util.ConnectionState;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
import com.mapswithme.util.sharing.TargetUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.List;
import java.util.Objects;
@@ -251,7 +250,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
Intent intent = new Intent(getContext(), SendLinkPlaceholderActivity.class)
.putExtra(SendLinkPlaceholderFragment.EXTRA_CATEGORY, mCategory);
startActivity(intent);
- Statistics.INSTANCE.trackSharingOptionsClick(Statistics.ParamValue.EDIT_ON_WEB);
}
private void onPublishedCategoryShared()
@@ -265,7 +263,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
.setType(TargetUtils.TYPE_TEXT_PLAIN)
.putExtra(Intent.EXTRA_TEXT, getString(R.string.share_bookmarks_email_body_link, link));
startActivity(Intent.createChooser(intent, getString(R.string.share)));
- Statistics.INSTANCE.trackSharingOptionsClick(Statistics.ParamValue.COPY_LINK);
}
private void onDirectLinkShared()
@@ -289,8 +286,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
.build();
dialog.setTargetFragment(this, REQ_CODE_NO_NETWORK_CONNECTION_DIALOG);
dialog.show(this, NO_NETWORK_CONNECTION_DIALOG_TAG);
- Statistics.INSTANCE.trackSharingOptionsError(Statistics.EventName.BM_SHARING_OPTIONS_ERROR,
- Statistics.NetworkErrorType.NO_NETWORK);
}
private boolean isNetworkConnectionAbsent()
@@ -315,7 +310,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
mCurrentMode = BookmarkCategory.AccessRules.ACCESS_RULES_PUBLIC;
onUploadBtnClicked();
- Statistics.INSTANCE.trackSharingOptionsClick(Statistics.ParamValue.PUBLIC);
}
private void onGetDirectLinkClicked()
@@ -327,7 +321,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
}
mCurrentMode = BookmarkCategory.AccessRules.ACCESS_RULES_DIRECT_LINK;
requestUpload();
- Statistics.INSTANCE.trackSharingOptionsClick(Statistics.ParamValue.PRIVATE);
}
private void onUploadBtnClicked()
@@ -431,14 +424,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
{
if (success)
onPostAuthCompleted();
- else
- onPostAuthFailed();
- }
-
- private void onPostAuthFailed()
- {
- Statistics.INSTANCE.trackSharingOptionsError(Statistics.EventName.BM_SHARING_OPTIONS_ERROR,
- Statistics.NetworkErrorType.AUTH_FAILED);
}
@Override
@@ -504,8 +489,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
private void onUploadError(@NonNull BookmarkManager.UploadResult uploadResult)
{
- Statistics.INSTANCE.trackSharingOptionsError(Statistics.EventName.BM_SHARING_OPTIONS_UPLOAD_ERROR,
- uploadResult.ordinal());
if (uploadResult == BookmarkManager.UploadResult.UPLOAD_RESULT_MALFORMED_DATA_ERROR)
{
showHtmlFormattingError();
@@ -541,7 +524,6 @@ public class UgcSharingOptionsFragment extends BaseToolbarAuthFragment implement
: R.string.upload_and_publish_success;
Utils.showSnackbar(requireContext(), getViewOrThrow(), successMsgResId);
toggleViews();
- Statistics.INSTANCE.trackSharingOptionsUploadSuccess(mCategory);
}
private void checkSuccessUploadedCategoryAccessRules()
diff --git a/android/src/com/mapswithme/maps/widget/SearchToolbarController.java b/android/src/com/mapswithme/maps/widget/SearchToolbarController.java
index 9c65c407f3..2e264d4739 100644
--- a/android/src/com/mapswithme/maps/widget/SearchToolbarController.java
+++ b/android/src/com/mapswithme/maps/widget/SearchToolbarController.java
@@ -31,8 +31,6 @@ import com.mapswithme.util.InputUtils;
import com.mapswithme.util.StringUtils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.Utils;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
import java.util.ArrayList;
import java.util.List;
@@ -80,9 +78,6 @@ public class SearchToolbarController extends ToolbarController
private final View.OnClickListener mChooseDatesClickListener = v -> {
if (!ConnectionState.INSTANCE.isConnected())
{
- Statistics.INSTANCE.trackQuickFilterClickError(Statistics.EventParam.HOTEL,
- Statistics.ParamValue.DATE,
- Statistics.ParamValue.NO_INTERNET);
FilterUtils.showNoNetworkConnectionDialog((AppCompatActivity) requireActivity());
return;
}
@@ -105,9 +100,6 @@ public class SearchToolbarController extends ToolbarController
private final View.OnClickListener mRoomsClickListener = v -> {
if (!ConnectionState.INSTANCE.isConnected())
{
- Statistics.INSTANCE.trackQuickFilterClickError(Statistics.EventParam.HOTEL,
- Statistics.ParamValue.ROOMS,
- Statistics.ParamValue.NO_INTERNET);
FilterUtils.showNoNetworkConnectionDialog((AppCompatActivity) requireActivity());
return;
}
@@ -296,7 +288,6 @@ public class SearchToolbarController extends ToolbarController
}
catch (ActivityNotFoundException e)
{
- AlohaHelper.logException(e);
}
}
@@ -376,9 +367,6 @@ public class SearchToolbarController extends ToolbarController
if (mFilterContainer == null)
return;
- if (getActivity() != null && UiUtils.isHidden(mFilterContainer) && show)
- Statistics.INSTANCE.trackQuickFilterOpen(Statistics.EventParam.HOTEL);
-
UiUtils.showIf(show, mFilterContainer);
}
diff --git a/android/src/com/mapswithme/maps/widget/StackedButtonDialogFragment.java b/android/src/com/mapswithme/maps/widget/StackedButtonDialogFragment.java
index a97efe23f5..d55cbc664b 100644
--- a/android/src/com/mapswithme/maps/widget/StackedButtonDialogFragment.java
+++ b/android/src/com/mapswithme/maps/widget/StackedButtonDialogFragment.java
@@ -11,7 +11,6 @@ import androidx.fragment.app.FragmentTransaction;
import com.mapswithme.maps.R;
import com.mapswithme.util.Config;
import com.mapswithme.util.NetworkPolicy;
-import com.mapswithme.util.statistics.Statistics;
public class StackedButtonDialogFragment extends DialogFragment
{
@@ -44,8 +43,6 @@ public class StackedButtonDialogFragment extends DialogFragment
private void onDialogBtnClicked(@NonNull NetworkPolicy.Type type, boolean canUse)
{
- Statistics.INSTANCE.trackNetworkUsageAlert(Statistics.EventName.MOBILE_INTERNET_ALERT,
- type.toStatisticValue());
Config.setUseMobileDataSettings(type);
if (mListener != null)
mListener.onResult(NetworkPolicy.newInstance(canUse));
diff --git a/android/src/com/mapswithme/maps/widget/menu/GuestsRoomsMenuRenderer.java b/android/src/com/mapswithme/maps/widget/menu/GuestsRoomsMenuRenderer.java
index 23078b8809..06f5c7b64f 100644
--- a/android/src/com/mapswithme/maps/widget/menu/GuestsRoomsMenuRenderer.java
+++ b/android/src/com/mapswithme/maps/widget/menu/GuestsRoomsMenuRenderer.java
@@ -4,12 +4,8 @@ import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.mapswithme.maps.R;
import com.mapswithme.maps.search.FilterUtils;
import com.mapswithme.maps.widget.InteractiveCounterView;
-import com.mapswithme.util.statistics.Statistics;
-
-import java.util.Objects;
public class GuestsRoomsMenuRenderer implements MenuRenderer
{
@@ -64,19 +60,6 @@ public class GuestsRoomsMenuRenderer implements MenuRenderer
@Override
public void initialize(@Nullable View view)
{
- Objects.requireNonNull(view);
- mRoomsView = view.findViewById(R.id.rooms);
- mRoomsView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.ROOMS,
- mRoomsView.getCurrentValue()));
- mAdultsView = view.findViewById(R.id.adults);
- mAdultsView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.ADULTS,
- mAdultsView.getCurrentValue()));
- mChildrenView = view.findViewById(R.id.children);
- mChildrenView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.CHILDREN,
- mChildrenView.getCurrentValue()));
- mInfantsView = view.findViewById(R.id.infants);
- mInfantsView.setChangeListener(() -> onChangeCounterValue(Statistics.EventParam.INFANTS,
- mInfantsView.getCurrentValue()));
}
@Override
@@ -87,9 +70,4 @@ public class GuestsRoomsMenuRenderer implements MenuRenderer
mChildrenView.setChangeListener(null);
mInfantsView.setChangeListener(null);
}
-
- private void onChangeCounterValue(@NonNull String name, int count)
- {
- Statistics.INSTANCE.trackQuickFilterClick(Statistics.EventParam.HOTEL, name, count);
- }
}
diff --git a/android/src/com/mapswithme/maps/widget/menu/MainMenu.java b/android/src/com/mapswithme/maps/widget/menu/MainMenu.java
index 16f9901e80..4e9824d6a6 100644
--- a/android/src/com/mapswithme/maps/widget/menu/MainMenu.java
+++ b/android/src/com/mapswithme/maps/widget/menu/MainMenu.java
@@ -13,9 +13,6 @@ import com.mapswithme.maps.maplayer.Mode;
import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.util.SharedPropertiesUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.StatisticValueConverter;
-
-import java.util.Locale;
public class MainMenu extends BaseMenu
{
@@ -51,7 +48,7 @@ public class MainMenu extends BaseMenu
private final MenuToggle mToggle;
- public enum Item implements BaseMenu.Item, StatisticValueConverter
+ public enum Item implements BaseMenu.Item
{
MENU(R.id.toggle)
{
@@ -176,13 +173,6 @@ public class MainMenu extends BaseMenu
@NonNull
public abstract ClickMenuDelegate createClickDelegate(@NonNull MwmActivity activity,
@NonNull Item item);
-
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return name().toLowerCase(Locale.ENGLISH);
- }
}
private void mapItem(MainMenu.Item item)
@@ -276,7 +266,7 @@ public class MainMenu extends BaseMenu
mapItem(Item.DOWNLOAD_MAPS);
mapItem(Item.SETTINGS);
- setState(State.MENU, false, false);
+ setState(State.MENU, false);
}
public MainMenu(View frame, ItemClickListener- itemClickListener)
@@ -300,7 +290,7 @@ public class MainMenu extends BaseMenu
return R.dimen.menu_line_height;
}
- public void setState(State state, boolean animateToggle, boolean isFullScreen)
+ public void setState(State state, boolean isFullScreen)
{
if (state != State.NAVIGATION)
{
diff --git a/android/src/com/mapswithme/maps/widget/placepage/DirectionFragment.java b/android/src/com/mapswithme/maps/widget/placepage/DirectionFragment.java
index efd7273c39..af93fff50d 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/DirectionFragment.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/DirectionFragment.java
@@ -18,10 +18,7 @@ import com.mapswithme.maps.bookmarks.data.MapObject;
import com.mapswithme.maps.location.LocationHelper;
import com.mapswithme.maps.location.LocationListener;
import com.mapswithme.maps.widget.ArrowView;
-import com.mapswithme.util.LocationUtils;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.AlohaHelper;
-import com.mapswithme.util.statistics.Statistics;
public class DirectionFragment extends BaseMwmDialogFragment
implements LocationListener
@@ -45,16 +42,9 @@ public class DirectionFragment extends BaseMwmDialogFragment
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
final View root = inflater.inflate(R.layout.fragment_direction, container, false);
- root.setOnTouchListener(new View.OnTouchListener()
- {
- @Override
- public boolean onTouch(View v, MotionEvent event)
- {
- dismiss();
- Statistics.INSTANCE.trackEvent(Statistics.EventName.PP_DIRECTION_ARROW_CLOSE);
- AlohaHelper.logClick(AlohaHelper.PP_DIRECTION_ARROW_CLOSE);
- return false;
- }
+ root.setOnTouchListener((v, event) -> {
+ dismiss();
+ return false;
});
initViews(root);
if (savedInstanceState != null)
diff --git a/android/src/com/mapswithme/maps/widget/placepage/EditBookmarkFragment.java b/android/src/com/mapswithme/maps/widget/placepage/EditBookmarkFragment.java
index 1942d9e05e..33a1e99e2c 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/EditBookmarkFragment.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/EditBookmarkFragment.java
@@ -28,7 +28,6 @@ import com.mapswithme.maps.bookmarks.data.FilterStrategy;
import com.mapswithme.maps.bookmarks.data.Icon;
import com.mapswithme.util.Graphics;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.OnClickListener, Listener
{
@@ -198,7 +197,6 @@ public class EditBookmarkFragment extends BaseMwmDialogFragment implements View.
if (TextUtils.equals(from, to))
return;
- Statistics.INSTANCE.trackColorChanged(from, to);
mIcon = newIcon;
refreshColorMarker();
}
diff --git a/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java b/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java
index c0c9b6e7ec..c692bc87e0 100644
--- a/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java
+++ b/android/src/com/mapswithme/maps/widget/placepage/ElevationProfileViewRenderer.java
@@ -14,7 +14,6 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.ElevationInfo;
import com.mapswithme.maps.routing.RoutingController;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Objects;
@@ -155,24 +154,16 @@ public class ElevationProfileViewRenderer implements PlacePageViewRenderer com.mapswithme.maps.widget.placepage.GalleryAdapter.MAX_COUNT)
{
@@ -1068,29 +1032,18 @@ public class PlacePageView extends NestedScrollViewClickFixed
{
partnerAppOpenMode = Utils.PartnerAppOpenMode.Direct;
UserActionsLogger.logBookingBookClicked();
- Statistics.INSTANCE.trackBookHotelEvent(info, mMapObject);
}
else if (isDetails)
{
UserActionsLogger.logBookingDetailsClicked();
- Statistics.INSTANCE.trackHotelEvent(PP_SPONSORED_DETAILS, info, mMapObject);
}
else
{
UserActionsLogger.logBookingMoreClicked();
- Statistics.INSTANCE.trackHotelEvent(PP_HOTEL_DESCRIPTION_LAND, info, mMapObject);
}
break;
case Sponsored.TYPE_OPENTABLE:
- if (mMapObject != null)
- Statistics.INSTANCE.trackRestaurantEvent(PP_SPONSORED_OPENTABLE, info,
- mMapObject);
- break;
case Sponsored.TYPE_PARTNER:
- if (mMapObject != null && !info.getPartnerName().isEmpty())
- Statistics.INSTANCE.trackSponsoredObjectEvent(PP_SPONSORED_ACTION, info,
- mMapObject);
- break;
case Sponsored.TYPE_NONE:
break;
}
@@ -1116,7 +1069,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
catch (ActivityNotFoundException e)
{
LOGGER.e(TAG, "Failed to handle click on sponsored: ", e);
- AlohaHelper.logException(e);
}
}
});
@@ -1810,15 +1762,11 @@ public class PlacePageView extends NestedScrollViewClickFixed
private void addOrganisation()
{
- Statistics.INSTANCE.trackEvent(Statistics.EventName.EDITOR_ADD_CLICK,
- Statistics.params()
- .add(Statistics.EventParam.FROM, "placepage"));
getActivity().showPositionChooser(true, false);
}
private void addPlace()
{
- // TODO add statistics
getActivity().showPositionChooser(false, true);
}
@@ -1849,10 +1797,7 @@ public class PlacePageView extends NestedScrollViewClickFixed
throw new AssertionError("A local ad must be non-null if button is shown!");
if (!TextUtils.isEmpty(localAdInfo.getUrl()))
- {
- Statistics.INSTANCE.trackPPOwnershipButtonClick(mMapObject);
Utils.openUrl(getContext(), localAdInfo.getUrl());
- }
}
break;
case R.id.ll__more:
@@ -1887,8 +1832,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
Utils.openUrl(getContext(), mMapObject.getMetadata(Metadata.MetadataType.FMD_WIKIPEDIA));
break;
case R.id.direction_frame:
- Statistics.INSTANCE.trackEvent(Statistics.EventName.PP_DIRECTION_ARROW);
- AlohaHelper.logClick(AlohaHelper.PP_DIRECTION_ARROW);
showBigDirection();
break;
case R.id.ll__place_email:
@@ -1899,8 +1842,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
mTvHotelDescription.setMaxLines(Integer.MAX_VALUE);
break;
case R.id.tv__place_hotel_facilities_more:
- if (mSponsored != null && mMapObject != null)
- Statistics.INSTANCE.trackHotelEvent(PP_HOTEL_FACILITIES, mSponsored, mMapObject);
UiUtils.hide(mHotelMoreFacilities);
mFacilitiesAdapter.setShowAll(true);
break;
@@ -1911,24 +1852,12 @@ public class PlacePageView extends NestedScrollViewClickFixed
//noinspection ConstantConditions
Utils.openUrl(getContext(), mSponsored.getReviewUrl());
UserActionsLogger.logBookingReviewsClicked();
- if (mMapObject != null)
- Statistics.INSTANCE.trackHotelEvent(PP_HOTEL_REVIEWS_LAND, mSponsored, mMapObject);
}
break;
case R.id.tv__place_page_order_taxi:
RoutingController.get().prepare(LocationHelper.INSTANCE.getMyPosition(), mMapObject,
Framework.ROUTER_TYPE_TAXI);
close();
- if (mMapObject != null)
- {
- List types = mMapObject.getReachableByTaxiTypes();
- if (types != null && !types.isEmpty())
- {
- String providerName = types.get(0).getProviderName();
- Statistics.INSTANCE.trackTaxiEvent(Statistics.EventName.ROUTING_TAXI_CLICK_IN_PP,
- providerName);
- }
- }
break;
case R.id.search_hotels_btn:
if (mMapObject == null)
@@ -1941,11 +1870,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
mMapObject.getPriceRate(),
mMapObject.getHotelType());
getActivity().onSearchSimilarHotels(filter);
- String provider = mSponsored != null && mSponsored.getType() == Sponsored.TYPE_BOOKING
- ? Statistics.ParamValue.BOOKING_COM : Statistics.ParamValue.OSM;
- Statistics.INSTANCE.trackEvent(Statistics.EventName.PP_HOTEL_SEARCH_SIMILAR,
- Statistics.params().add(Statistics.EventParam.PROVIDER,
- provider));
break;
}
}
@@ -1971,7 +1895,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
{
final Object tag = v.getTag();
final String tagStr = tag == null ? "" : tag.toString();
- AlohaHelper.logLongClick(tagStr);
final PopupMenu popup = new PopupMenu(getContext(), v);
final Menu menu = popup.getMenu();
@@ -2025,8 +1948,6 @@ public class PlacePageView extends NestedScrollViewClickFixed
final int id = item.getItemId();
final Context ctx = getContext();
Utils.copyTextToClipboard(ctx, items.get(id));
- Statistics.INSTANCE.trackEvent(Statistics.EventName.PP_METADATA_COPY + ":" + tagStr);
- AlohaHelper.logClick(AlohaHelper.PP_METADATA_COPY + ":" + tagStr);
Utils.showSnackbarAbove(findViewById(R.id.pp__details_frame),
getRootView().findViewById(R.id.menu_frame),
ctx.getString(R.string.copied_to_clipboard, items.get(id)));
diff --git a/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java b/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java
index 6a9e50d495..abac78bdd2 100644
--- a/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java
+++ b/android/src/com/mapswithme/util/MultipleTrackerReferrerReceiver.java
@@ -7,7 +7,6 @@ import android.util.Log;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.AlohaHelper;
import static com.mapswithme.maps.MwmApplication.backgroundTracker;
diff --git a/android/src/com/mapswithme/util/NetworkPolicy.java b/android/src/com/mapswithme/util/NetworkPolicy.java
index ead7e4ca49..3c4ed39b4a 100644
--- a/android/src/com/mapswithme/util/NetworkPolicy.java
+++ b/android/src/com/mapswithme/util/NetworkPolicy.java
@@ -4,34 +4,17 @@ import androidx.annotation.NonNull;
import androidx.fragment.app.FragmentManager;
import com.mapswithme.maps.widget.StackedButtonDialogFragment;
-import com.mapswithme.util.statistics.StatisticValueConverter;
-import com.mapswithme.util.statistics.Statistics;
import java.util.concurrent.TimeUnit;
public final class NetworkPolicy
{
- public enum Type implements StatisticValueConverter
+ public enum Type
{
- ASK()
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return Statistics.ParamValue.ASK;
- }
- },
+ ASK,
ALWAYS()
{
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return Statistics.ParamValue.ALWAYS;
- }
-
@Override
public void check(@NonNull FragmentManager fragmentManager,
@NonNull NetworkPolicyListener listener, boolean isDialogAllowed)
@@ -48,13 +31,6 @@ public final class NetworkPolicy
NEVER()
{
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return Statistics.ParamValue.NEVER;
- }
-
@Override
public void check(@NonNull FragmentManager fragmentManager,
@NonNull NetworkPolicyListener listener, boolean isDialogAllowed)
@@ -69,13 +45,6 @@ public final class NetworkPolicy
NOT_TODAY()
{
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return Statistics.ParamValue.NOT_TODAY;
- }
-
@Override
public void check(@NonNull FragmentManager fragmentManager,
@NonNull NetworkPolicyListener listener, boolean isDialogAllowed)
@@ -89,13 +58,6 @@ public final class NetworkPolicy
TODAY()
{
- @NonNull
- @Override
- public String toStatisticValue()
- {
- return Statistics.ParamValue.TODAY;
- }
-
@Override
public void check(@NonNull FragmentManager fragmentManager,
@NonNull NetworkPolicyListener listener, boolean isDialogAllowed)
@@ -110,15 +72,7 @@ public final class NetworkPolicy
}
},
- NONE
- {
- @NonNull
- @Override
- public String toStatisticValue()
- {
- throw new UnsupportedOperationException("Not supported here " + name());
- }
- };
+ NONE;
public void check(@NonNull FragmentManager fragmentManager,
@NonNull final NetworkPolicyListener listener,
diff --git a/android/src/com/mapswithme/util/Utils.java b/android/src/com/mapswithme/util/Utils.java
index 0943cf0944..96e84623d2 100644
--- a/android/src/com/mapswithme/util/Utils.java
+++ b/android/src/com/mapswithme/util/Utils.java
@@ -6,7 +6,6 @@ import android.content.ClipData;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.net.Uri;
@@ -35,12 +34,10 @@ import com.google.android.material.snackbar.Snackbar;
import com.mapswithme.maps.BuildConfig;
import com.mapswithme.maps.MwmApplication;
import com.mapswithme.maps.R;
-import com.mapswithme.maps.analytics.ExternalLibrariesMediator;
import com.mapswithme.maps.base.CustomNavigateUpListener;
import com.mapswithme.util.concurrency.UiThread;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
-import com.mapswithme.util.statistics.AlohaHelper;
import java.io.Closeable;
import java.io.IOException;
@@ -230,7 +227,7 @@ public class Utils
activity.startActivity(marketIntent);
} catch (ActivityNotFoundException e)
{
- AlohaHelper.logException(e);
+ LOGGER.e(TAG, "Failed to start activity", e);
}
}
@@ -399,20 +396,6 @@ public class Utils
}).show();
}
- @NonNull
- public static String getInstallationId(@NonNull Context context)
- {
- final SharedPreferences sharedPrefs = context.getSharedPreferences(
- org.alohalytics.Statistics.PREF_FILE, Context.MODE_PRIVATE);
- // "UNIQUE_ID" is the value of org.alohalytics.Statistics.PREF_UNIQUE_ID, but it private.
- String installationId = sharedPrefs.getString("UNIQUE_ID", null);
-
- if (TextUtils.isEmpty(installationId))
- return "";
-
- return installationId;
- }
-
@NonNull
public static String getMacAddress(@NonNull Context context, boolean md5Decoded)
{
@@ -551,7 +534,6 @@ public class Utils
catch (ActivityNotFoundException e)
{
LOGGER.e(TAG, "Failed to call phone", e);
- AlohaHelper.logException(e);
}
}
diff --git a/android/src/com/mapswithme/util/log/FileLoggerStrategy.java b/android/src/com/mapswithme/util/log/FileLoggerStrategy.java
index 8c1cf9f336..494df9d46b 100644
--- a/android/src/com/mapswithme/util/log/FileLoggerStrategy.java
+++ b/android/src/com/mapswithme/util/log/FileLoggerStrategy.java
@@ -179,7 +179,6 @@ class FileLoggerStrategy implements LoggerStrategy
fw.write("Android version: " + Build.VERSION.SDK_INT + "\n");
fw.write("Device: " + Utils.getFullDeviceModel() + "\n");
fw.write("App version: " + BuildConfig.APPLICATION_ID + " " + BuildConfig.VERSION_NAME + "\n");
- fw.write("Installation ID: " + Utils.getInstallationId(application) + "\n");
fw.write("Locale : " + Locale.getDefault());
fw.write("\nNetworks : ");
final ConnectivityManager manager = (ConnectivityManager) application.getSystemService(Context.CONNECTIVITY_SERVICE);
diff --git a/android/src/com/mapswithme/util/sharing/BaseShareable.java b/android/src/com/mapswithme/util/sharing/BaseShareable.java
index c4b872115f..94e45df836 100644
--- a/android/src/com/mapswithme/util/sharing/BaseShareable.java
+++ b/android/src/com/mapswithme/util/sharing/BaseShareable.java
@@ -7,7 +7,6 @@ import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import android.text.TextUtils;
-import com.mapswithme.util.statistics.AlohaHelper;
abstract class BaseShareable
{
@@ -63,7 +62,6 @@ abstract class BaseShareable
mActivity.startActivity(intent);
} catch (ActivityNotFoundException ignored)
{
- AlohaHelper.logException(ignored);
}
}
diff --git a/android/src/com/mapswithme/util/sharing/BookmarkInfoShareable.java b/android/src/com/mapswithme/util/sharing/BookmarkInfoShareable.java
index c892387096..092e53f771 100644
--- a/android/src/com/mapswithme/util/sharing/BookmarkInfoShareable.java
+++ b/android/src/com/mapswithme/util/sharing/BookmarkInfoShareable.java
@@ -9,7 +9,6 @@ import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.maps.widget.placepage.Sponsored;
import com.mapswithme.util.UiUtils;
-import com.mapswithme.util.statistics.Statistics;
import java.util.Arrays;
@@ -83,11 +82,4 @@ class BookmarkInfoShareable extends BaseShareab
{
return null;
}
-
- @Override
- public void share(SharingTarget target)
- {
- super.share(target);
- Statistics.INSTANCE.trackPlaceShared(target.name);
- }
}
diff --git a/android/src/com/mapswithme/util/statistics/Analytics.java b/android/src/com/mapswithme/util/statistics/Analytics.java
deleted file mode 100644
index c822386f3e..0000000000
--- a/android/src/com/mapswithme/util/statistics/Analytics.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.mapswithme.util.statistics;
-
-import androidx.annotation.NonNull;
-
-public class Analytics
-{
- @NonNull
- private final String mName;
-
- public Analytics(@NonNull String name)
- {
- mName = name;
- }
-
- @NonNull
- public String getName()
- {
- return mName;
- }
-}
diff --git a/android/src/com/mapswithme/util/statistics/Destination.java b/android/src/com/mapswithme/util/statistics/Destination.java
deleted file mode 100644
index 9675cdfbc9..0000000000
--- a/android/src/com/mapswithme/util/statistics/Destination.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.mapswithme.util.statistics;
-
-public enum Destination
-{
- ROUTING,
- PLACEPAGE,
- SEARCH,
- EXTERNAL,
- CATALOGUE
-}
diff --git a/android/src/com/mapswithme/util/statistics/GalleryPlacement.java b/android/src/com/mapswithme/util/statistics/GalleryPlacement.java
deleted file mode 100644
index 7368592baa..0000000000
--- a/android/src/com/mapswithme/util/statistics/GalleryPlacement.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.mapswithme.util.statistics;
-
-public enum GalleryPlacement
-{
- PLACEPAGE,
- DISCOVERY,
- PLACEPAGE_LARGE_TOPONYMS,
- PLACEPAGE_SIGHTSEEINGS,
- PLACEPAGE_OUTDOOR,
- MAP
-}
diff --git a/android/src/com/mapswithme/util/statistics/GalleryState.java b/android/src/com/mapswithme/util/statistics/GalleryState.java
deleted file mode 100644
index 053c614372..0000000000
--- a/android/src/com/mapswithme/util/statistics/GalleryState.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package com.mapswithme.util.statistics;
-
-public enum GalleryState
-{
- ONLINE,
- OFFLINE,
-}
diff --git a/android/src/com/mapswithme/util/statistics/GalleryType.java b/android/src/com/mapswithme/util/statistics/GalleryType.java
deleted file mode 100644
index b62a4aa3b4..0000000000
--- a/android/src/com/mapswithme/util/statistics/GalleryType.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.mapswithme.util.statistics;
-
-import androidx.annotation.NonNull;
-
-public enum GalleryType
-{
- LOCAL_EXPERTS
- {
- @NonNull
- @Override
- public String getProvider()
- {
- return Statistics.ParamValue.LOCALS_EXPERTS;
- }
- },
- SEARCH_RESTAURANTS
- {
- @NonNull
- @Override
- public String getProvider()
- {
- return Statistics.ParamValue.SEARCH_RESTAURANTS;
- }
- },
- SEARCH_ATTRACTIONS
- {
- @NonNull
- @Override
- public String getProvider()
- {
- return Statistics.ParamValue.SEARCH_ATTRACTIONS;
- }
- },
- SEARCH_HOTELS
- {
- @NonNull
- @Override
- public String getProvider()
- {
- return Statistics.ParamValue.BOOKING_COM;
- }
- },
- PROMO
- {
- @NonNull
- @Override
- public String getProvider()
- {
- return Statistics.ParamValue.MAPSME_GUIDES;
- }
- };
-
- @NonNull
- public abstract String getProvider();
-}
diff --git a/android/src/com/mapswithme/util/statistics/StatisticValueConverter.java b/android/src/com/mapswithme/util/statistics/StatisticValueConverter.java
deleted file mode 100644
index 92c8be34e6..0000000000
--- a/android/src/com/mapswithme/util/statistics/StatisticValueConverter.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.mapswithme.util.statistics;
-
-import androidx.annotation.NonNull;
-
-public interface StatisticValueConverter
-{
- @NonNull
- T toStatisticValue();
-}
diff --git a/android/src/com/mapswithme/util/statistics/Statistics.java b/android/src/com/mapswithme/util/statistics/Statistics.java
deleted file mode 100644
index 0b318120d3..0000000000
--- a/android/src/com/mapswithme/util/statistics/Statistics.java
+++ /dev/null
@@ -1,2082 +0,0 @@
-package com.mapswithme.util.statistics;
-
-import android.app.Activity;
-import android.content.Context;
-import android.location.Location;
-import android.net.NetworkInfo;
-import android.net.Uri;
-import android.text.TextUtils;
-import android.util.Pair;
-
-import androidx.annotation.IntDef;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import com.android.billingclient.api.BillingClient;
-import com.mapswithme.maps.BuildConfig;
-import com.mapswithme.maps.Framework;
-import com.mapswithme.maps.PrivateVariables;
-import com.mapswithme.maps.analytics.ExternalLibrariesMediator;
-import com.mapswithme.maps.api.ParsedMwmRequest;
-import com.mapswithme.maps.base.Initializable;
-import com.mapswithme.maps.bookmarks.data.BookmarkCategory;
-import com.mapswithme.maps.bookmarks.data.BookmarkManager;
-import com.mapswithme.maps.bookmarks.data.MapObject;
-import com.mapswithme.maps.downloader.MapManager;
-import com.mapswithme.maps.editor.Editor;
-import com.mapswithme.maps.editor.OsmOAuth;
-import com.mapswithme.maps.location.LocationHelper;
-import com.mapswithme.maps.maplayer.Mode;
-import com.mapswithme.maps.purchase.ValidationStatus;
-import com.mapswithme.maps.routing.RoutePointInfo;
-import com.mapswithme.maps.routing.RoutingOptions;
-import com.mapswithme.maps.settings.RoadType;
-import com.mapswithme.maps.taxi.TaxiManager;
-import com.mapswithme.maps.taxi.TaxiType;
-import com.mapswithme.maps.widget.menu.MainMenu;
-import com.mapswithme.maps.widget.placepage.Sponsored;
-import com.mapswithme.util.BatteryState;
-import com.mapswithme.util.Config;
-import com.mapswithme.util.ConnectionState;
-import com.mapswithme.util.Counters;
-import com.mapswithme.util.CrashlyticsUtils;
-import com.mapswithme.util.PowerManagment;
-import com.mapswithme.util.SharedPropertiesUtils;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
-import static com.mapswithme.util.BatteryState.CHARGING_STATUS_PLUGGED;
-import static com.mapswithme.util.BatteryState.CHARGING_STATUS_UNKNOWN;
-import static com.mapswithme.util.BatteryState.CHARGING_STATUS_UNPLUGGED;
-import static com.mapswithme.util.statistics.Statistics.EventName.APPLICATION_COLD_STARTUP_INFO;
-import static com.mapswithme.util.statistics.Statistics.EventName.AUTH_DECLINED;
-import static com.mapswithme.util.statistics.Statistics.EventName.AUTH_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.AUTH_EXTERNAL_REQUEST_SUCCESS;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_BOOKMARKS_LIST_CATEGORY_SELECT;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_BOOKMARKS_LIST_COLLECTION_SELECT;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_BOOKMARKS_VISIBILITY_CHANGE;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_GUIDES_DOWNLOADDIALOGUE_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_GUIDE_VISIBILITY_CHANGE;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_RESTORE_PROPOSAL_SUCCESS;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_PROPOSAL_APPROVED;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_PROPOSAL_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_PROPOSAL_SHOWN;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_PROPOSAL_TOGGLE;
-import static com.mapswithme.util.statistics.Statistics.EventName.BM_SYNC_SUCCESS;
-import static com.mapswithme.util.statistics.Statistics.EventName.DOWNLOADER_DIALOG_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.ELEVATION_PROFILE_PAGE_CLOSE;
-import static com.mapswithme.util.statistics.Statistics.EventName.ELEVATION_PROFILE_PAGE_OPEN;
-import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_BOOKMARK_SELECT;
-import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_OPEN;
-import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_SHOWN;
-import static com.mapswithme.util.statistics.Statistics.EventName.GUIDES_TRACK_SELECT;
-import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_PREVIEW_SELECT;
-import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_PREVIEW_SHOW;
-import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_PRODUCT_DELIVERED;
-import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_STORE_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.INAPP_PURCHASE_VALIDATION_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_BANNER_CLOSE;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_BANNER_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_OWNERSHIP_BUTTON_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_SPONSORED_BOOK;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_SPONSORED_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_SPONSORED_OPEN;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_SPONSORED_SHOWN;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_SPONSORED_USER_ITEM;
-import static com.mapswithme.util.statistics.Statistics.EventName.PP_SPONSOR_ITEM_SELECTED;
-import static com.mapswithme.util.statistics.Statistics.EventName.ROUTING_PLAN_TOOLTIP_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.ROUTING_ROUTE_FINISH;
-import static com.mapswithme.util.statistics.Statistics.EventName.ROUTING_ROUTE_START;
-import static com.mapswithme.util.statistics.Statistics.EventName.SEARCH_FILTER_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.SEARCH_QUICKFILTER_APPLY;
-import static com.mapswithme.util.statistics.Statistics.EventName.SEARCH_QUICKFILTER_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.SEARCH_QUICKFILTER_OPEN;
-import static com.mapswithme.util.statistics.Statistics.EventName.TIPS_TRICKS_CLOSE;
-import static com.mapswithme.util.statistics.Statistics.EventName.TOOLBAR_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.TOOLBAR_MENU_CLICK;
-import static com.mapswithme.util.statistics.Statistics.EventName.UGC_AUTH_ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventName.UGC_AUTH_EXTERNAL_REQUEST_SUCCESS;
-import static com.mapswithme.util.statistics.Statistics.EventName.UGC_REVIEW_START;
-import static com.mapswithme.util.statistics.Statistics.EventParam.ACTION;
-import static com.mapswithme.util.statistics.Statistics.EventParam.BANNER;
-import static com.mapswithme.util.statistics.Statistics.EventParam.BATTERY;
-import static com.mapswithme.util.statistics.Statistics.EventParam.BUTTON;
-import static com.mapswithme.util.statistics.Statistics.EventParam.CATEGORY;
-import static com.mapswithme.util.statistics.Statistics.EventParam.CHARGING;
-import static com.mapswithme.util.statistics.Statistics.EventParam.COUNT_LOWERCASE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.DESTINATION;
-import static com.mapswithme.util.statistics.Statistics.EventParam.ERROR;
-import static com.mapswithme.util.statistics.Statistics.EventParam.ERROR_CODE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.ERROR_MESSAGE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.FEATURE_ID;
-import static com.mapswithme.util.statistics.Statistics.EventParam.FILTER;
-import static com.mapswithme.util.statistics.Statistics.EventParam.FILTERS;
-import static com.mapswithme.util.statistics.Statistics.EventParam.FIRST_LAUNCH;
-import static com.mapswithme.util.statistics.Statistics.EventParam.FROM;
-import static com.mapswithme.util.statistics.Statistics.EventParam.HAS_AUTH;
-import static com.mapswithme.util.statistics.Statistics.EventParam.HOTEL;
-import static com.mapswithme.util.statistics.Statistics.EventParam.HOTEL_LAT;
-import static com.mapswithme.util.statistics.Statistics.EventParam.HOTEL_LON;
-import static com.mapswithme.util.statistics.Statistics.EventParam.ID;
-import static com.mapswithme.util.statistics.Statistics.EventParam.INTERRUPTED;
-import static com.mapswithme.util.statistics.Statistics.EventParam.ITEM;
-import static com.mapswithme.util.statistics.Statistics.EventParam.MAP_DATA_SIZE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.METHOD;
-import static com.mapswithme.util.statistics.Statistics.EventParam.MODE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.MWM_NAME;
-import static com.mapswithme.util.statistics.Statistics.EventParam.MWM_VERSION;
-import static com.mapswithme.util.statistics.Statistics.EventParam.NAME;
-import static com.mapswithme.util.statistics.Statistics.EventParam.NETWORK;
-import static com.mapswithme.util.statistics.Statistics.EventParam.OBJECT_LAT;
-import static com.mapswithme.util.statistics.Statistics.EventParam.OBJECT_LON;
-import static com.mapswithme.util.statistics.Statistics.EventParam.OPTION;
-import static com.mapswithme.util.statistics.Statistics.EventParam.PLACEMENT;
-import static com.mapswithme.util.statistics.Statistics.EventParam.PRODUCT;
-import static com.mapswithme.util.statistics.Statistics.EventParam.PROVIDER;
-import static com.mapswithme.util.statistics.Statistics.EventParam.PURCHASE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.RESTAURANT;
-import static com.mapswithme.util.statistics.Statistics.EventParam.RESTAURANT_LAT;
-import static com.mapswithme.util.statistics.Statistics.EventParam.RESTAURANT_LON;
-import static com.mapswithme.util.statistics.Statistics.EventParam.SERVER_ID;
-import static com.mapswithme.util.statistics.Statistics.EventParam.SERVER_IDS;
-import static com.mapswithme.util.statistics.Statistics.EventParam.STATE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.TRIAL;
-import static com.mapswithme.util.statistics.Statistics.EventParam.TURN_ON;
-import static com.mapswithme.util.statistics.Statistics.EventParam.TYPE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.VALUE;
-import static com.mapswithme.util.statistics.Statistics.EventParam.VENDOR;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.BACKUP;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.BICYCLE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.BOOKING_COM;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.DISK_NO_SPACE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.FALSE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.GOOGLE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.HOLIDAY;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.MAPSME;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.MAPSME_GUIDES;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.NO_BACKUP;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.OFFSCREEEN;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.OPENTABLE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.PARTNER;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.PEDESTRIAN;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.PHONE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.RESTORE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.SEARCH_BOOKING_COM;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.TAXI;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.TRAFFIC;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.TRANSIT;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.TRUE;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.UNKNOWN;
-import static com.mapswithme.util.statistics.Statistics.ParamValue.VEHICLE;
-
-public enum Statistics implements Initializable
-{
- INSTANCE;
-
- @NonNull
- public static ParameterBuilder makeInAppSuggestionParamBuilder()
- {
- return new ParameterBuilder()
- .add(EventParam.SCENARIO, BOOKING_COM)
- .add(PROVIDER, MAPSME_GUIDES);
- }
-
- @NonNull
- public static ParameterBuilder makeDownloaderBannerParamBuilder(@NonNull String provider,
- @NonNull String mwmId)
- {
- return new ParameterBuilder()
- .add(EventParam.FROM, ParamValue.MAP)
- .add(PROVIDER, provider)
- .add(MWM_NAME, mwmId);
- }
-
- @NonNull
- public static ParameterBuilder makeGuidesSubscriptionBuilder()
- {
- return new ParameterBuilder().add(EventParam.TARGET,
- ParamValue.GUIDES_SUBSCRIPTION);
- }
-
- public void trackCategoryDescChanged()
- {
- trackEditSettingsScreenOptionClick(ParamValue.ADD_DESC);
- }
-
- public void trackSharingOptionsClick(@NonNull String value)
- {
- ParameterBuilder builder = new ParameterBuilder().add(OPTION, value);
- trackEvent(EventName.BM_SHARING_OPTIONS_CLICK, builder);
- }
-
- public void trackSharingOptionsError(@NonNull String error,
- @NonNull NetworkErrorType value)
- {
- trackSharingOptionsError(error, value.ordinal());
- }
-
- public void trackSharingOptionsError(@NonNull String error, int value)
- {
- ParameterBuilder builder = new ParameterBuilder().add(EventParam.ERROR, value);
- trackEvent(error, builder);
- }
-
- public void trackSharingOptionsUploadSuccess(@NonNull BookmarkCategory category)
- {
- ParameterBuilder builder = new ParameterBuilder().add(EventParam.TRACKS, category.getTracksCount())
- .add(EventParam.POINTS, category.getBookmarksCount());
- trackEvent(EventName.BM_SHARING_OPTIONS_UPLOAD_SUCCESS, builder);
- }
-
- public void trackBookmarkListSettingsClick(@NonNull Analytics analytics)
- {
- ParameterBuilder builder = ParameterBuilder.from(OPTION, analytics);
- trackEvent(EventName.BM_BOOKMARKS_LIST_SETTINGS_CLICK, builder);
- }
-
- @NonNull
- private static String getStatisticsSortingType(@BookmarkManager.SortingType int sortingType)
- {
- switch (sortingType)
- {
- case BookmarkManager.SORT_BY_TYPE:
- return Statistics.ParamValue.BY_TYPE;
- case BookmarkManager.SORT_BY_DISTANCE:
- return Statistics.ParamValue.BY_DISTANCE;
- case BookmarkManager.SORT_BY_TIME:
- return Statistics.ParamValue.BY_DATE;
- }
- throw new AssertionError("Invalid sorting type");
- }
-
- public void trackBookmarksListSort(@BookmarkManager.SortingType int sortingType)
- {
- trackBookmarksListSort(getStatisticsSortingType(sortingType));
- }
-
- public void trackBookmarksListResetSort()
- {
- trackBookmarksListSort(Statistics.ParamValue.BY_DEFAULT);
- }
-
- private void trackBookmarksListSort(@NonNull String value)
- {
- ParameterBuilder builder = new ParameterBuilder().add(EventParam.OPTION, value);
- trackEvent(EventName.BM_BOOKMARKS_LIST_SORT, builder);
- }
-
- public void trackBookmarksListSearch()
- {
- trackBookmarksSearch(ParamValue.BOOKMARKS_LIST);
- }
-
- private void trackBookmarksSearch(@NonNull String value)
- {
- ParameterBuilder builder = new ParameterBuilder().add(EventParam.FROM, value);
- trackEvent(EventName.BM_BOOKMARKS_SEARCH, builder);
- }
-
- public void trackBookmarksListSearchResultSelected()
- {
- trackBookmarksSearchResultSelected(ParamValue.BOOKMARKS_LIST);
- }
-
- private void trackBookmarksSearchResultSelected(@NonNull String value)
- {
- ParameterBuilder builder = new ParameterBuilder().add(EventParam.FROM, value);
- trackEvent(EventName.BM_BOOKMARKS_SEARCH_RESULT_SELECTED, builder);
- }
-
- public void trackBookmarksVisibility(@NonNull String from, @NonNull String action,
- @Nullable String serverId)
- {
- ParameterBuilder builder = new ParameterBuilder();
- builder.add(FROM, from).add(ACTION, action);
- if (!TextUtils.isEmpty(serverId))
- builder.add(SERVER_ID, serverId);
- trackEvent(BM_BOOKMARKS_VISIBILITY_CHANGE, builder.get());
- }
-
- private void trackEditSettingsScreenOptionClick(@NonNull String value)
- {
- ParameterBuilder builder = new ParameterBuilder().add(OPTION, value);
- trackEvent(EventName.BM_EDIT_SETTINGS_CLICK, builder);
- }
-
- public void trackEditSettingsCancel()
- {
- trackEvent(EventName.BM_EDIT_SETTINGS_CANCEL);
- }
-
- public void trackEditSettingsConfirm()
- {
- trackEvent(EventName.BM_EDIT_SETTINGS_CONFIRM);
- }
-
- public void trackEditSettingsSharingOptionsClick()
- {
- trackEditSettingsScreenOptionClick(Statistics.ParamValue.SHARING_OPTIONS);
- }
-
- public void trackBookmarkListSharingOptions()
- {
- trackEvent(Statistics.EventName.BM_BOOKMARKS_LIST_ITEM_SETTINGS,
- new Statistics.ParameterBuilder().add(OPTION,
- Statistics.ParamValue.SHARING_OPTIONS));
- }
-
- public void trackSettingsDrivingOptionsChangeEvent(@NonNull String componentDescent)
- {
- boolean hasToll = RoutingOptions.hasOption(RoadType.Toll);
- boolean hasFerry = RoutingOptions.hasOption(RoadType.Ferry);
- boolean hasMoto = RoutingOptions.hasOption(RoadType.Motorway);
- boolean hasDirty = RoutingOptions.hasOption(RoadType.Dirty);
-
- ParameterBuilder builder = new ParameterBuilder();
- ParameterBuilder parameterBuilder = builder.add(EventParam.TOLL, hasToll ? 1 : 0)
- .add(EventParam.FERRY, hasFerry ? 1 : 0)
- .add(EventParam.MOTORWAY, hasMoto ? 1 : 0)
- .add(EventParam.UNPAVED, hasDirty ? 1 : 0);
- parameterBuilder.add(EventParam.FROM, componentDescent);
-
- trackEvent(EventName.SETTINGS_DRIVING_OPTIONS_CHANGE, parameterBuilder);
- }
-
- @Retention(RetentionPolicy.SOURCE)
- @IntDef({ PP_BANNER_STATE_PREVIEW, PP_BANNER_STATE_DETAILS })
- public @interface BannerState
- {
- }
-
- public static final int PP_BANNER_STATE_PREVIEW = 0;
- public static final int PP_BANNER_STATE_DETAILS = 1;
-
- @Retention(RetentionPolicy.SOURCE)
- @IntDef({ STATISTICS_CHANNEL_DEFAULT, STATISTICS_CHANNEL_REALTIME })
- public @interface StatisticsChannel
- {
- }
-
- public static final int STATISTICS_CHANNEL_DEFAULT = org.alohalytics.Statistics.ONLY_CHANNEL;
- private static final int REALTIME_CHANNEL_INDEX = 1;
- public static final int STATISTICS_CHANNEL_REALTIME = STATISTICS_CHANNEL_DEFAULT | (1 << REALTIME_CHANNEL_INDEX);
-
- // Statistics counters
- private int mBookmarksCreated;
- private int mSharedTimes;
-
- public static class EventName
- {
- // Downloader
- public static final String DOWNLOADER_ERROR = "Downloader_Map_error";
- public static final String DOWNLOADER_ACTION = "Downloader_Map_action";
- public static final String DOWNLOADER_CANCEL = "Downloader_Cancel_downloading";
- public static final String DOWNLOADER_DIALOG_SHOW = "Downloader_OnStartScreen_show";
- public static final String DOWNLOADER_DIALOG_MANUAL_DOWNLOAD = "Downloader_OnStartScreen_manual_download";
- public static final String DOWNLOADER_DIALOG_DOWNLOAD = "Downloader_OnStartScreen_auto_download";
- public static final String DOWNLOADER_DIALOG_LATER = "Downloader_OnStartScreen_select_later";
- public static final String DOWNLOADER_DIALOG_HIDE = "Downloader_OnStartScreen_select_hide";
- public static final String DOWNLOADER_DIALOG_CANCEL = "Downloader_OnStartScreen_cancel_download";
-
- public static final String PLACEPAGE_DESCRIPTION_MORE = "Placepage_Description_more";
- public static final String PLACEPAGE_DESCRIPTION_OUTBOUND_CLICK = "Placepage_Description_Outbound_click";
- public static final String SETTINGS_SPEED_CAMS = "Settings. Speed_cameras";
- public static final String SETTINGS_MOBILE_INTERNET_CHANGE = "Settings_MobileInternet_change";
- public static final String SETTINGS_RECENT_TRACK_CHANGE = "Settings_RecentTrack_change";
- public static final String MOBILE_INTERNET_ALERT = "MobileInternet_alert";
- public static final String MAP_TOAST_SHOW = "Map_Toast_show";
- public static final String AUTH_ERROR = "Auth_error";
- static final String SETTINGS_TRACKING_DETAILS = "Settings_Tracking_details";
- static final String SETTINGS_TRACKING_TOGGLE = "Settings_Tracking_toggle";
-
- public static final String DOWNLOADER_BANNER_SHOW = "Downloader_Banner_show";
- public static final String DOWNLOADER_BANNER_CLICK = "Downloader_Banner_click";
- public static final String DOWNLOADER_FAB_CLICK = "Downloader_AddMap_click";
- public static final String DOWNLOADER_SEARCH_CLICK = "Downloader_Search_click";
- public static final String WHATS_NEW_ACTION = "WhatsNew_action";
- static final String DOWNLOADER_DIALOG_ERROR = "Downloader_OnStartScreen_error";
-
- // bookmarks
- public static final String BM_SHARING_OPTIONS_UPLOAD_ERROR = "Bookmarks_SharingOptions_upload_error";
- public static final String BM_SHARING_OPTIONS_ERROR = "Bookmarks_SharingOptions_error";
- public static final String BM_GROUP_CREATED = "Bookmark. Group created";
- public static final String BM_GROUP_CHANGED = "Bookmark. Group changed";
- public static final String BM_SYNC_PROPOSAL_ENABLED = "Bookmarks_SyncProposal_enabled";
- public static final String BM_SYNC_STARTED = "Bookmarks_sync_started";
- public static final String BM_EDIT_ON_WEB_CLICK = "Bookmarks_EditOnWeb_click";
- public static final String BM_RESTORE_PROPOSAL_CANCEL = "Bookmarks_RestoreProposal_cancel";
- public static final String BM_GUIDEDOWNLOADTOAST_SHOWN = "Bookmarks_GuideDownloadToast_shown";
- public static final String PP_DRIVING_OPTIONS_ACTION = "Placepage_DrivingOptions_action";
- static final String BM_SHARING_OPTIONS_CLICK = "Bookmarks_SharingOptions_click";
- static final String BM_EDIT_SETTINGS_CLICK = "Bookmarks_Bookmark_Settings_click";
- static final String BM_EDIT_SETTINGS_CANCEL = "Bookmarks_Bookmark_Settings_cancel";
- static final String BM_EDIT_SETTINGS_CONFIRM = "Bookmarks_Bookmark_Settings_confirm";
- static final String BM_BOOKMARKS_LIST_SETTINGS_CLICK = "Bookmarks_BookmarksList_settings_click";
- static final String BM_BOOKMARKS_LIST_ITEM_SETTINGS = "Bookmarks_BookmarksListItem_settings";
- static final String BM_BOOKMARKS_LIST_SORT = "Bookmarks_BookmarksList_sort";
- static final String BM_BOOKMARKS_SEARCH = "Bookmarks_Search";
- static final String BM_BOOKMARKS_SEARCH_RESULT_SELECTED = "Bookmarks_Search_result_selected";
- static final String BM_BOOKMARKS_VISIBILITY_CHANGE = "Bookmarks_Visibility_change";
- static final String BM_COLOR_CHANGED = "Bookmark. Color changed";
- static final String BM_CREATED = "Bookmark. Bookmark created";
- static final String BM_SYNC_PROPOSAL_SHOWN = "Bookmarks_SyncProposal_shown";
- static final String BM_SYNC_PROPOSAL_APPROVED = "Bookmarks_SyncProposal_approved";
- static final String BM_SYNC_PROPOSAL_ERROR = "Bookmarks_SyncProposal_error";
- static final String BM_SYNC_PROPOSAL_TOGGLE = "Settings_BookmarksSync_toggle";
- static final String BM_SYNC_ERROR = "Bookmarks_sync_error";
- static final String BM_SYNC_SUCCESS = "Bookmarks_sync_success";
- static final String BM_RESTORE_PROPOSAL_CLICK = "Bookmarks_RestoreProposal_click";
- static final String BM_RESTORE_PROPOSAL_SUCCESS = "Bookmarks_RestoreProposal_success";
- static final String BM_RESTORE_PROPOSAL_ERROR = "Bookmarks_RestoreProposal_error";
- static final String BM_TAB_CLICK = "Bookmarks_Tab_click";
- static final String BM_GUIDES_DOWNLOADDIALOGUE_CLICK = "Bookmarks_Guides_DownloadDialogue_click";
- static final String SETTINGS_DRIVING_OPTIONS_CHANGE = "Settings_Navigation_DrivingOptions_change";
- private static final String BM_SHARING_OPTIONS_UPLOAD_SUCCESS = "Bookmarks_SharingOptions_upload_success";
- private static final String BM_DOWNLOADED_CATALOGUE_OPEN = "Bookmarks_Downloaded_Catalogue_open";
- private static final String BM_DOWNLOADED_CATALOGUE_ERROR = "Bookmarks_Downloaded_Catalogue_error";
- public static final String BM_BOOKMARKS_LIST_COLLECTION_SELECT = "Bookmarks_BookmarksList_Collection_select";
- public static final String BM_BOOKMARKS_LIST_CATEGORY_SELECT = "Bookmarks_BookmarksList_Category_select";
- public static final String BM_GUIDE_VISIBILITY_CHANGE = "Bookmarks_Guide_Visibility_change";
-
- // search
- public static final String SEARCH_ITEM_CLICKED = "Search. Key clicked";
- public static final String SEARCH_ON_MAP_CLICKED = "Search. View on map clicked.";
- public static final String SEARCH_SPONSOR_CATEGORY_SHOWN = "Search_SponsoredCategory_shown";
- public static final String SEARCH_SPONSOR_CATEGORY_SELECTED = "Search_SponsoredCategory_selected";
- static final String SEARCH_FILTER_OPEN = "Search_Filter_Open";
- public static final String SEARCH_FILTER_CANCEL = "Search_Filter_Cancel";
- public static final String SEARCH_FILTER_RESET = "Search_Filter_Reset";
- public static final String SEARCH_FILTER_APPLY = "Search_Filter_Apply";
- static final String SEARCH_QUICKFILTER_OPEN = "Search_QuickFilter_Open";
- static final String SEARCH_QUICKFILTER_CLICK = "Search_QuickFilter_Click";
- static final String SEARCH_QUICKFILTER_APPLY = "Search_QuickFilter_Apply";
- static final String SEARCH_QUICKFILTER_CLICK_ERROR = "Search_QuickFilter_Click_error";
- static final String SEARCH_CONTEXTAREA_CLICK = "Search_ContextArea_Click";
- static final String SEARCH_CAT_CLICKED = "Search. Category clicked";
- static final String SEARCH_TAB_SELECTED = "Search_Tab_selected";
- static final String SEARCH_FILTER_CLICK = "Search_Filter_Click";
-
- // place page
- public static final String PP_SHARE = "PP. Share";
- public static final String PP_BOOKMARK = "PP. Bookmark";
- public static final String PP_SPONSORED_DETAILS = "Placepage_Hotel_details";
- public static final String PP_SPONSORED_OPENTABLE = "Placepage_Restaurant_book";
- public static final String PP_SPONSORED_ACTION = "Placepage_SponsoredActionButton_click";
- public static final String PP_SPONSOR_MORE_SELECTED = "Placepage_SponsoredGallery_MoreItem_selected";
- public static final String PP_DIRECTION_ARROW = "PP. DirectionArrow";
- public static final String PP_DIRECTION_ARROW_CLOSE = "PP. DirectionArrowClose";
- public static final String PP_METADATA_COPY = "PP. CopyMetadata";
- public static final String PP_BANNER_CLICK = "Placepage_Banner_click";
- public static final String PP_HOTEL_GALLERY_OPEN = "PlacePage_Hotel_Gallery_open";
- public static final String PP_HOTEL_REVIEWS_LAND = "PlacePage_Hotel_Reviews_land";
- public static final String PP_HOTEL_DESCRIPTION_LAND = "PlacePage_Hotel_Description_land";
- public static final String PP_HOTEL_FACILITIES = "PlacePage_Hotel_Facilities_open";
- public static final String PP_HOTEL_SEARCH_SIMILAR = "Placepage_Hotel_search_similar";
- static final String PP_DETAILS_OPEN = "Placepage_Details_open";
- static final String PP_SPONSORED_BOOK = "Placepage_Hotel_book";
- static final String PP_SPONSORED_OPEN = "Placepage_SponsoredGalleryPage_opened";
- static final String PP_SPONSORED_SHOWN = "Placepage_SponsoredGallery_shown";
- static final String PP_SPONSORED_ERROR = "Placepage_SponsoredGallery_error";
- static final String PP_SPONSOR_ITEM_SELECTED = "Placepage_SponsoredGallery_ProductItem_selected";
- static final String PP_SPONSORED_USER_ITEM = "Placepage_SponsoredGallery_UsersItem_shown";
- static final String PP_BANNER_SHOW = "Placepage_Banner_show";
- static final String PP_BANNER_ERROR = "Placepage_Banner_error";
- static final String PP_BANNER_CLOSE = "Placepage_Banner_close";
- static final String PP_OWNERSHIP_BUTTON_CLICK = "Placepage_OwnershipButton_click";
-
- //elevation profile
- static final String ELEVATION_PROFILE_PAGE_OPEN = "ElevationProfilePage_open";
- static final String ELEVATION_PROFILE_PAGE_CLOSE = "ElevationProfilePage_close";
-
- // toolbar actions
- public static final String TOOLBAR_MY_POSITION = "Toolbar. MyPosition";
- static final String TOOLBAR_CLICK = "Toolbar_click";
- static final String TOOLBAR_MENU_CLICK = "Toolbar_Menu_click";
-
- // dialogs
- public static final String RATE_DIALOG_LATER = "GPlay dialog cancelled.";
- static final String RATE_DIALOG_RATED = "GPlay dialog. Rating set";
-
- // misc
- public static final String ZOOM_IN = "Zoom. In";
- public static final String ZOOM_OUT = "Zoom. Out";
- public static final String DOWNLOAD_COUNTRY_NOTIFICATION_SHOWN = "Download country notification shown";
- public static final String TTS_FAILURE_LOCATION = "TTS failure location";
- public static final String UGC_NOT_AUTH_NOTIFICATION_SHOWN = "UGC_UnsentNotification_shown";
- public static final String UGC_NOT_AUTH_NOTIFICATION_CLICKED = "UGC_UnsentNotification_clicked";
- public static final String UGC_REVIEW_NOTIFICATION_SHOWN = "UGC_ReviewNotification_shown";
- public static final String UGC_REVIEW_NOTIFICATION_CLICKED = "UGC_ReviewNotification_clicked";
- static final String PLACE_SHARED = "Place Shared";
- static final String API_CALLED = "API called";
- static final String ACTIVE_CONNECTION = "Connection";
- static final String STATISTICS_STATUS_CHANGED = "Statistics status changed";
-
- // routing
- public static final String ROUTING_START_SUGGEST_REBUILD = "Routing. Suggest rebuild";
- public static final String ROUTING_CANCEL = "Routing. Cancel";
- public static final String ROUTING_VEHICLE_SET = "Routing. Set vehicle";
- public static final String ROUTING_PEDESTRIAN_SET = "Routing. Set pedestrian";
- public static final String ROUTING_BICYCLE_SET = "Routing. Set bicycle";
- public static final String ROUTING_TAXI_SET = "Routing. Set taxi";
- public static final String ROUTING_TRANSIT_SET = "Routing. Set transit";
- public static final String ROUTING_SWAP_POINTS = "Routing. Swap points";
- public static final String ROUTING_SETTINGS = "Routing. Settings";
- public static final String ROUTING_TAXI_CLICK_IN_PP = "Placepage_Taxi_click";
- public static final String ROUTING_TAXI_ROUTE_BUILT = "Routing_Build_Taxi";
- public static final String ROUTING_POINT_ADD = "Routing_Point_add";
- public static final String ROUTING_POINT_REMOVE = "Routing_Point_remove";
- public static final String ROUTING_SEARCH_CLICK = "Routing_Search_click";
- public static final String ROUTING_BOOKMARKS_CLICK = "Routing_Bookmarks_click";
- static final String ROUTING_BUILD = "Routing. Build";
- static final String ROUTING_ROUTE_START = "Routing_Route_start";
- static final String ROUTING_ROUTE_FINISH = "Routing_Route_finish";
- static final String ROUTING_TAXI_ORDER = "Routing_Taxi_order";
- static final String ROUTING_TAXI_INSTALL = "Routing_Taxi_install";
- static final String ROUTING_TAXI_SHOW = "Placepage_Taxi_show";
- static final String ROUTING_PLAN_TOOLTIP_CLICK = "Routing_PlanTooltip_click";
-
- // editor
- public static final String EDITOR_ADD_CLICK = "Editor_Add_click";
- public static final String EDITOR_AUTH_DECLINED = "Editor_Auth_declined_by_user";
- public static final String EDITOR_AUTH_REQUEST_RESULT = "Editor_Auth_request_result";
- public static final String EDITOR_REG_REQUEST = "Editor_Reg_request";
- public static final String EDITOR_LOST_PASSWORD = "Editor_Lost_password";
- public static final String EDITOR_SHARE_SHOW = "Editor_SecondTimeShare_show";
- public static final String EDITOR_SHARE_CLICK = "Editor_SecondTimeShare_click";
- static final String EDITOR_START_CREATE = "Editor_Add_start";
- static final String EDITOR_START_EDIT = "Editor_Edit_start";
- static final String EDITOR_SUCCESS_CREATE = "Editor_Add_success";
- static final String EDITOR_SUCCESS_EDIT = "Editor_Edit_success";
- static final String EDITOR_ERROR_CREATE = "Editor_Add_error";
- static final String EDITOR_ERROR_EDIT = "Editor_Edit_error";
- static final String EDITOR_AUTH_REQUEST = "Editor_Auth_request";
-
- // Cold start
- static final String APPLICATION_COLD_STARTUP_INFO = "Application_ColdStartup_info";
-
- // Ugc.
- public static final String UGC_REVIEW_CANCEL = "UGC_Review_cancel";
- public static final String UGC_REVIEW_SUCCESS = "UGC_Review_success";
- public static final String UGC_AUTH_SHOWN = "UGC_Auth_shown";
- public static final String UGC_AUTH_DECLINED = "UGC_Auth_declined";
- static final String UGC_REVIEW_START = "UGC_Review_start";
- static final String UGC_AUTH_EXTERNAL_REQUEST_SUCCESS = "UGC_Auth_external_request_success";
- static final String UGC_AUTH_ERROR = "UGC_Auth_error";
- static final String MAP_LAYERS_CLICK = "Map_Layers_click";
-
- public static final String AUTH_SHOWN = "Auth_shown";
- public static final String AUTH_DECLINED = "Auth_declined";
- public static final String AUTH_START = "Auth_start";
-
- // Purchases.
- public static final String INAPP_PURCHASE_PREVIEW_PAY = "InAppPurchase_Preview_pay";
- public static final String INAPP_PURCHASE_PREVIEW_CANCEL = "InAppPurchase_Preview_cancel";
- public static final String INAPP_PURCHASE_PREVIEW_RESTORE = "InAppPurchase_Preview_restore";
- public static final String INAPP_PURCHASE_STORE_SUCCESS = "InAppPurchase_Store_success";
- public static final String INAPP_PURCHASE_VALIDATION_SUCCESS = "InAppPurchase_Validation_success";
- static final String INAPP_PURCHASE_PREVIEW_SHOW = "InAppPurchase_Preview_show";
- static final String INAPP_PURCHASE_PREVIEW_SELECT = "InAppPurchase_Preview_select";
- static final String INAPP_PURCHASE_STORE_ERROR = "InAppPurchase_Store_error";
- static final String INAPP_PURCHASE_VALIDATION_ERROR = "InAppPurchase_Validation_error";
- static final String INAPP_PURCHASE_PRODUCT_DELIVERED = "InAppPurchase_Product_delivered";
-
- public static final String ONBOARDING_SCREEN_SHOW = "OnboardingScreen_show";
- public static final String ONBOARDING_SCREEN_ACCEPT = "OnboardingScreen_accept";
- public static final String ONBOARDING_SCREEN_DECLINE = "OnboardingScreen_decline";
- public static final String ONBOARDING_DEEPLINK_SCREEN_SHOW = "OnboardingDeeplinkScreen_show";
- public static final String ONBOARDING_DEEPLINK_SCREEN_ACCEPT = "OnboardingDeeplinkScreen_accept";
- public static final String ONBOARDING_DEEPLINK_SCREEN_DECLINE = "OnboardingDeeplinkScreen_decline";
-
- public static final String TIPS_TRICKS_SHOW = "TipsTricks_show";
- public static final String TIPS_TRICKS_CLICK = "TipsTricks_click";
- static final String TIPS_TRICKS_CLOSE = "TipsTricks_close";
-
- public static final String INAPP_SUGGESTION_SHOWN = "MapsMe_InAppSuggestion_shown";
- public static final String INAPP_SUGGESTION_CLICKED = "MapsMe_InAppSuggestion_clicked";
- public static final String INAPP_SUGGESTION_CLOSED = "MapsMe_InAppSuggestion_closed";
-
- public static final String MAP_SPONSORED_BUTTON_CLICK = "Map_SponsoredButton_click";
- public static final String MAP_SPONSORED_BUTTON_SHOW = "Map_SponsoredButton_show";
- static final String GUIDES_SHOWN = "Bookmarks_Downloaded_Guides_list";
- static final String GUIDES_OPEN = "Bookmarks_Downloaded_Guide_open";
- static final String GUIDES_BOOKMARK_SELECT = "Bookmarks_BookmarksList_Bookmark_select";
- static final String GUIDES_TRACK_SELECT = "Bookmarks_BookmarksList_Track_select";
-
- public static final String DEEPLINK_CALL = "Deeplink_call";
- public static final String DEEPLINK_CALL_MISSED = "Deeplink_call_missed";
- public static final String AUTH_EXTERNAL_REQUEST_SUCCESS = "Auth_external_request_success";
- public static final String AUTH_REQUEST_SUCCESS = "Auth_request_success";
-
- public static class Settings
- {
- public static final String WEB_SITE = "Setings. Go to website";
- public static final String FEEDBACK_GENERAL = "Send general feedback to android@omaps.app";
- public static final String REPORT_BUG = "Settings. Bug reported";
- public static final String RATE = "Settings. Rate app called";
- public static final String TELL_FRIEND = "Settings. Tell to friend";
- public static final String FACEBOOK = "Settings. Go to FB.";
- public static final String TWITTER = "Settings. Go to twitter.";
- public static final String HELP = "Settings. Help.";
- public static final String ABOUT = "Settings. About.";
- public static final String OSM_PROFILE = "Settings. Profile.";
- public static final String COPYRIGHT = "Settings. Copyright.";
- public static final String UNITS = "Settings. Change units.";
- public static final String ZOOM = "Settings. Switch zoom.";
- public static final String MAP_STYLE = "Settings. Map style.";
- public static final String VOICE_ENABLED = "Settings. Switch voice.";
- public static final String VOICE_LANGUAGE = "Settings. Voice language.";
- static final String ENERGY_SAVING = "Settings_EnergySaving_change";
-
- private Settings()
- {
- }
- }
-
- private EventName()
- {
- }
- }
-
- public static class EventParam
- {
- public static final String FROM = "from";
- public static final String TO = "to";
- public static final String OPTION = "option";
- public static final String URL = "url";
- public static final String SETTINGS = "settings";
- public static final String ROUTE = "route";
- public static final String BUTTON = "button";
- public static final String SCREEN = "screen";
- public static final String VERSION = "version";
- public static final String TAB = "tab";
- public static final String ENABLED = "Enabled";
- public static final String TURN_ON = "turn_on";
- public static final String RATING = "Rating";
- public static final String LANGUAGE = "language";
- public static final String NAME = "Name";
- public static final String ACTION = "action";
- public static final String TYPE = "type";
- public static final String IS_SUCCESS = "is_success_message";
- public static final String ERR_MSG = "error_message";
- public static final String OSM = "OSM";
- public static final String PROVIDER = "provider";
- public static final String HOTEL = "hotel";
- public static final String ERROR = "error";
- public static final String VALUE = "value";
- public static final String PRICE_CATEGORY = "price_category";
- public static final String DATE = "date";
- public static final String STATUS = "status";
- public static final String SOURCE = "source";
- public static final String GUIDE_CATALOGUE = "guide_catalogue";
- public static final String SUBSCRIPTION = "subscription";
- public static final String EXPORT_BOOKMARKS = "export_bookmarks";
- public static final String BOOKMARKS_BACKUP = "bookmarks_backup";
- public static final String AFTER_SAVE_REVIEW = "after_save_review";
- public static final String ROOMS = "rooms";
- public static final String ADULTS = "adults";
- public static final String CHILDREN = "children";
- public static final String INFANTS = "infants";
- static final String BANNER = "banner";
- static final String BATTERY = "battery";
- static final String CALLER_ID = "Caller ID";
- static final String CATEGORY = "category";
- static final String CHANNEL = "Channel";
- static final String CHARGING = "charging";
- static final String CONNECTION_FAST = "Connection fast";
- static final String CONNECTION_METERED = "Connection limit";
- static final String CONNECTION_TYPE = "Connection name";
- static final String COUNT = "Count";
- static final String COUNT_LOWERCASE = "count";
- static final String DESTINATION = "destination";
- static final String ERROR_CODE = "error_code";
- static final String ERROR_MESSAGE = "error_message";
- static final String FEATURE_ID = "feature_id";
- static final String FERRY = "ferry";
- public static final String FILTER = "filter";
- static final String FILTERS = "filters";
- static final String FIRST_LAUNCH = "first_launch";
- static final String FROM_LAT = "from_lat";
- static final String FROM_LON = "from_lon";
- static final String HAS_AUTH = "has_auth";
- static final String HOTEL_LAT = "hotel_lat";
- static final String HOTEL_LON = "hotel_lon";
- static final String ID = "id";
- static final String INTERRUPTED = "interrupted";
- static final String IS_AUTHENTICATED = "is_authenticated";
- static final String IS_ONLINE = "is_online";
- static final String ITEM = "item";
- static final String MAP_DATA_SIZE = "map_data_size:";
- static final String METHOD = "method";
- static final String MODE = "mode";
- static final String MOTORWAY = "motorway";
- static final String MWM_NAME = "mwm_name";
- static final String MWM_VERSION = "mwm_version";
- static final String MY_POSITION = "my position";
- static final String NETWORK = "network";
- static final String OBJECT_LAT = "object_lat";
- static final String OBJECT_LON = "object_lon";
- static final String PLACEMENT = "placement";
- static final String POINT = "point";
- static final String POINTS = "points";
- static final String PRODUCT = "product";
- static final String PURCHASE = "purchase";
- static final String RESTAURANT = "restaurant";
- static final String RESTAURANT_LAT = "restaurant_lat";
- static final String RESTAURANT_LON = "restaurant_lon";
- static final String SCENARIO = "scenario";
- static final String SERVER_ID = "server_id";
- static final String SERVER_IDS = "server_ids";
- static final String STATE = "state";
- static final String TARGET = "target";
- static final String TO_LAT = "to_lat";
- static final String TO_LON = "to_lon";
- static final String TOLL = "toll";
- static final String TRACKS = "tracks";
- static final String TRIAL = "trial";
- static final String UNPAVED = "unpaved";
- static final String VENDOR = "vendor";
-
- private EventParam()
- {
- }
- }
-
- public static class ParamValue
- {
- public static final String BOOKING_COM = "Booking.Com";
- public static final String OSM = "OSM";
- public static final String ON = "on";
- public static final String OFF = "off";
- public static final String SHARING_OPTIONS = "sharing_options";
- public static final String EDIT_ON_WEB = "edit_on_web";
- public static final String PUBLIC = "public";
- public static final String PRIVATE = "private";
- public static final String COPY_LINK = "copy_link";
- public static final String CANCEL = "Cancel";
- public static final String ALWAYS = "always";
- public static final String NEVER = "never";
- public static final String ASK = "ask";
- public static final String TODAY = "today";
- public static final String NOT_TODAY = "not_today";
- public static final String CARD = "card";
- public static final String SPONSORED_BUTTON = "sponsored_button";
- public static final String POPUP = "popup";
- public static final String WEBVIEW = "webview";
- public static final String WHATSNEW = "whatsnew";
- public static final String ONBOARDING_GUIDES_SUBSCRIPTION = "onboarding_guides_subscription";
- public static final String PLUS = "plus";
- public static final String DOWNLOAD = "download";
- public static final String OPEN = "open";
- public static final String CLOSE = "close";
- public static final String NEXT = "next";
- public static final String NO_PRODUCTS = "no_products";
- public static final String EDIT = "edit";
- public static final String CHECKIN = "check_in";
- public static final String CHECKOUT = "check_out";
- public static final String ANY = "any";
- public static final String MAPSME = "mapsme";
- public static final String UNKNOWN = "unknown";
- public static final String NO_INTERNET = "no_internet";
- public static final String MY = "my";
- public static final String DOWNLOADED = "downloaded";
- public static final String SUCCESS = "success";
- public static final String UNAVAILABLE = "unavailable";
- public final static String VIEW_ON_MAP = "view on map";
- public final static String NOT_NOW = "not now";
- public final static String CLICK_OUTSIDE = "click outside pop-up";
- public static final String SEND_AS_FILE = "send_as_file";
- public static final String MAKE_INVISIBLE_ON_MAP = "make_invisible_on_map";
- public static final String LIST_SETTINGS = "list_settings";
- public static final String DELETE_GROUP = "delete_group";
- public static final String OFFSCREEEN = "Offscreen";
- public static final String MAPSME_GUIDES = "MapsMeGuides";
- public static final String TINKOFF_INSURANCE = "Tinkoff_Insurance";
- public static final String TINKOFF_ALL_AIRLINES = "Tinkoff_AllAirlines";
- public static final String SKYENG = "Skyeng";
- public static final String MTS = "MTS";
- public static final String MASTERCARD_SBERBANK = "MastercardSberbank";
- public static final String ARSENAL_MEDIC = "Arsenal_telemed";
- public static final String ARSENAL_FLAT = "Arsenal_flat";
- public static final String ARSENAL_INSURANCE_CRIMEA = "Arsenal_crimea";
- public static final String ARSENAL_INSURANCE_RUSSIA = "Arsenal_russia";
- public static final String ARSENAL_INSURANCE_WORLD = "Arsenal_abroad";
- public static final String WIKIPEDIA = "wikipedia";
- public static final String PREVIEW = "preview";
- public static final String FULL = "full";
- public static final String MAP_GALLERY = "map_gallery";
- public static final String BOOKMARK_LIST = "bookmark_list";
- public static final String SHOW = "show";
- public static final String HIDE = "hide";
- public static final String SHOW_ALL = "show_all";
- public static final String HIDE_ALL = "hide_all";
- public static final String NEW_OBJECT = "new_object";
- public static final String EDIT_OBJECT = "edit_object";
- public static final String DATE = "date";
- public static final String ROOMS = "rooms";
- public static final String MAIN = "main";
- public static final String COLLECTION = "collection";
- public static final String CATEGORY = "category";
- static final String CRASH_REPORTS = "crash_reports";
- static final String PERSONAL_ADS = "personal_ads";
- public static final String MAP = "map";
- public static final String LIST = "list";
- public static final String MENU = "menu";
- public static final String ISOLINES = "isolines";
- public static final String NOTIFICATION = "notification";
- static final String GOOGLE = "google";
- static final String PHONE = "phone";
- static final String ADD_DESC = "add_description";
- static final String BY_DEFAULT = "Default";
- static final String BY_DATE = "Date";
- static final String BY_DISTANCE = "Distance";
- static final String BY_TYPE = "Type";
- static final String BOOKMARKS_LIST = "BookmarksList";
- static final String GUIDES_SUBSCRIPTION = "OnboardingGuidesSubscription";
- static final String SEARCH_BOOKING_COM = "Search.Booking.Com";
- static final String OPENTABLE = "OpenTable";
- static final String LOCALS_EXPERTS = "Locals.Maps.Me";
- static final String SEARCH_RESTAURANTS = "Search.Restaurants";
- static final String SEARCH_ATTRACTIONS = "Search.Attractions";
- static final String HOLIDAY = "Holiday";
- static final String ADD = "add";
- static final String AFTER_SAVE = "after_save";
- static final String PLACEPAGE_PREVIEW = "placepage_preview";
- static final String PLACEPAGE = "placepage";
- static final String NETWORK = "network";
- static final String DISK = "disk";
- static final String AUTH = "auth";
- static final String USER_INTERRUPTED = "user_interrupted";
- static final String INVALID_CALL = "invalid_call";
- static final String NO_BACKUP = "no_backup";
- static final String DISK_NO_SPACE = "disk_no_space";
- static final String BACKUP = "backup";
- static final String RESTORE = "restore";
- static final String SUBWAY = "subway";
- static final String TRAFFIC = "traffic";
- static final String PEDESTRIAN = "pedestrian";
- static final String VEHICLE = "vehicle";
- static final String BICYCLE = "bicycle";
- static final String TAXI = "taxi";
- static final String TRANSIT = "transit";
- static final String PARTNER = "Partner";
- static final String TRUE = "True";
- static final String FALSE = "False";
- }
-
- // Initialized once in constructor and does not change until the process restarts.
- // In this way we can correctly finish all statistics sessions and completely
- // avoid their initialization if user has disabled statistics collection.
- private boolean mEnabled;
-
- @Override
- public void initialize(@Nullable Context context)
- {
- mEnabled = SharedPropertiesUtils.isStatisticsEnabled(context);
- // At the moment we need special handling for Alohalytics to enable/disable logging of events in core C++ code.
- if (mEnabled)
- org.alohalytics.Statistics.enable(context);
- else
- org.alohalytics.Statistics.disable(context);
- configure(context);
- }
-
- @Override
- public void destroy()
- {
- // No op.
- }
-
- @SuppressWarnings("NullableProblems")
- @NonNull
- private ExternalLibrariesMediator mMediator;
-
- public void setMediator(@NonNull ExternalLibrariesMediator mediator)
- {
- mMediator = mediator;
- }
-
- private void configure(Context context)
- {
- // At the moment, need to always initialize engine for correct JNI http part reusing.
- // Statistics is still enabled/disabled separately and never sent anywhere if turned off.
- // TODO (AlexZ): Remove this initialization dependency from JNI part.
- org.alohalytics.Statistics.setDebugMode(BuildConfig.DEBUG);
- org.alohalytics.Statistics.setup(new String[] { PrivateVariables.alohalyticsUrl(),
- PrivateVariables.alohalyticsRealtimeUrl() }, context);
- }
-
- public void trackEvent(@NonNull String name)
- {
- trackEvent(name, STATISTICS_CHANNEL_DEFAULT);
- }
-
- public void trackEvent(@NonNull String name, @StatisticsChannel int channel)
- {
- if (mEnabled)
- org.alohalytics.Statistics.logEvent(name, channel);
- mMediator.getEventLogger().logEvent(name, Collections.emptyMap());
- }
-
- public void trackEvent(@NonNull String name, @NonNull Map params)
- {
- trackEvent(name, params, STATISTICS_CHANNEL_DEFAULT);
- }
-
- public void trackEvent(@NonNull String name, @NonNull Map params,
- @StatisticsChannel int channel)
- {
- if (mEnabled)
- org.alohalytics.Statistics.logEvent(name, params, channel);
-
- mMediator.getEventLogger().logEvent(name, params);
- }
-
- public void trackEvent(@NonNull String name, @Nullable Location location,
- @NonNull Map params)
- {
- trackEvent(name, location, params, STATISTICS_CHANNEL_DEFAULT);
- }
-
- public void trackEvent(@NonNull String name, @Nullable Location location,
- @NonNull Map params, @StatisticsChannel int channel)
- {
- List eventDictionary = new ArrayList();
- for (Map.Entry entry : params.entrySet())
- {
- eventDictionary.add(entry.getKey());
- eventDictionary.add(entry.getValue());
- }
- params.put("lat", (location == null ? "N/A" : String.valueOf(location.getLatitude())));
- params.put("lon", (location == null ? "N/A" : String.valueOf(location.getLongitude())));
-
- if (mEnabled)
- org.alohalytics.Statistics.logEvent(name, eventDictionary.toArray(new String[0]), location, channel);
-
- mMediator.getEventLogger().logEvent(name, params);
- }
-
- public void trackEvent(@NonNull String name, @NonNull ParameterBuilder builder)
- {
- trackEvent(name, builder.get(), STATISTICS_CHANNEL_DEFAULT);
- }
-
- public void trackEvent(@NonNull String name, @NonNull ParameterBuilder builder,
- @StatisticsChannel int channel)
- {
- trackEvent(name, builder.get(), channel);
- }
-
- public void startActivity(Activity activity)
- {
- if (mEnabled)
- {
- org.alohalytics.Statistics.onStart(activity);
- }
-
- mMediator.getEventLogger().startActivity(activity);
- }
-
- public void stopActivity(Activity activity)
- {
- if (mEnabled)
- {
- org.alohalytics.Statistics.onStop(activity);
- }
- mMediator.getEventLogger().stopActivity(activity);
- }
-
- public void setStatEnabled(@NonNull Context context, boolean isEnabled)
- {
- SharedPropertiesUtils.setStatisticsEnabled(context, isEnabled);
- Config.setStatisticsEnabled(isEnabled);
-
- // We track if user turned on/off statistics to understand data better.
- trackEvent(EventName.STATISTICS_STATUS_CHANGED + " " + Counters.getInstallFlavor(context),
- params().add(EventParam.ENABLED, String.valueOf(isEnabled)));
- }
-
- public void trackSearchTabSelected(@NonNull String tab)
- {
- trackEvent(EventName.SEARCH_TAB_SELECTED, params().add(EventParam.TAB, tab));
- }
-
- public void trackSearchCategoryClicked(String category)
- {
- trackEvent(EventName.SEARCH_CAT_CLICKED, params().add(EventParam.CATEGORY, category));
- }
-
- public void trackColorChanged(String from, String to)
- {
- trackEvent(EventName.BM_COLOR_CHANGED, params().add(EventParam.FROM, from)
- .add(EventParam.TO, to));
- }
-
- public void trackBookmarkCreated()
- {
- trackEvent(EventName.BM_CREATED, params().add(EventParam.COUNT, String.valueOf(++mBookmarksCreated)));
- }
-
- public void trackPlaceShared(String channel)
- {
- trackEvent(EventName.PLACE_SHARED, params().add(EventParam.CHANNEL, channel)
- .add(EventParam.COUNT, String.valueOf(++mSharedTimes)));
- }
-
- public void trackApiCall(@NonNull ParsedMwmRequest request)
- {
- trackEvent(EventName.API_CALLED, params().add(EventParam.CALLER_ID, request.getCallerInfo() == null ?
- "null" :
- request.getCallerInfo().packageName));
- }
-
- public void trackRatingDialog(float rating)
- {
- trackEvent(EventName.RATE_DIALOG_RATED, params().add(EventParam.RATING, String.valueOf(rating)));
- }
-
- public void trackConnectionState()
- {
- if (ConnectionState.INSTANCE.isConnected())
- {
- final NetworkInfo info = ConnectionState.INSTANCE.getActiveNetwork();
- boolean isConnectionMetered = false;
- //noinspection ConstantConditions
- trackEvent(EventName.ACTIVE_CONNECTION,
- params().add(EventParam.CONNECTION_TYPE, info.getTypeName() + ":" + info.getSubtypeName())
- .add(EventParam.CONNECTION_FAST, String.valueOf(ConnectionState.INSTANCE.isConnectionFast(info)))
- .add(EventParam.CONNECTION_METERED, String.valueOf(isConnectionMetered)));
- }
- else
- trackEvent(EventName.ACTIVE_CONNECTION, params().add(EventParam.CONNECTION_TYPE, "Not connected."));
- }
-
- // FIXME Call to track map changes to MyTracker to correctly deal with preinstalls.
- public void trackMapChanged(String event)
- {
- if (mEnabled)
- {
- final ParameterBuilder params = params().add(EventParam.COUNT, String.valueOf(MapManager.nativeGetDownloadedCount()));
- trackEvent(event, params);
- }
- }
-
- public void trackRouteBuild(int routerType, MapObject from, MapObject to)
- {
- trackEvent(EventName.ROUTING_BUILD, params().add(EventParam.FROM, Statistics.getPointType(from))
- .add(EventParam.TO, Statistics.getPointType(to)));
- }
-
- public void trackEditorLaunch(boolean newObject, String valueOfIsAuthorized)
- {
- trackEvent(newObject ? EventName.EDITOR_START_CREATE : EventName.EDITOR_START_EDIT,
- editorMwmParams().add(EventParam.IS_AUTHENTICATED, valueOfIsAuthorized)
- .add(EventParam.IS_ONLINE, String.valueOf(ConnectionState.INSTANCE.isConnected())));
-
- }
-
- public void trackMapLayerClick(@NonNull Mode mode, @NonNull String from, boolean turnOn)
- {
- ParameterBuilder builder = params().add(NAME, mode.name().toLowerCase(Locale.ENGLISH))
- .add(FROM, from).add(TURN_ON, turnOn);
- trackEvent(EventName.MAP_LAYERS_CLICK, builder);
- }
-
- public void trackEditorSuccess(boolean newObject, String valueOfIsAuthorized)
- {
- trackEvent(newObject ? EventName.EDITOR_SUCCESS_CREATE : EventName.EDITOR_SUCCESS_EDIT,
- editorMwmParams().add(EventParam.IS_AUTHENTICATED, valueOfIsAuthorized)
- .add(EventParam.IS_ONLINE, String.valueOf(ConnectionState.INSTANCE.isConnected())));
- }
-
- public void trackEditorError(boolean newObject, String valueOfIsAuthorized)
- {
- trackEvent(newObject ? EventName.EDITOR_ERROR_CREATE : EventName.EDITOR_ERROR_EDIT,
- editorMwmParams().add(EventParam.IS_AUTHENTICATED, valueOfIsAuthorized)
- .add(EventParam.IS_ONLINE, String.valueOf(ConnectionState.INSTANCE.isConnected())));
- }
-
- public void trackNetworkUsageAlert(@NonNull String event, @NonNull String param)
- {
- trackEvent(event, Statistics.params().add(VALUE, param));
- }
-
- public void trackAuthRequest(OsmOAuth.AuthType type)
- {
- trackEvent(EventName.EDITOR_AUTH_REQUEST, Statistics.params()
- .add(Statistics.EventParam.TYPE, type.name));
- }
-
- public void trackTaxiInRoutePlanning(@Nullable MapObject from, @Nullable MapObject to,
- @Nullable Location location, @NonNull String providerName,
- boolean isAppInstalled)
- {
- Statistics.ParameterBuilder params = Statistics.params();
- params.add(Statistics.EventParam.PROVIDER, providerName);
-
- params.add(Statistics.EventParam.FROM_LAT, from != null ? String.valueOf(from.getLat()) : "N/A")
- .add(Statistics.EventParam.FROM_LON, from != null ? String.valueOf(from.getLon()) : "N/A");
-
- params.add(Statistics.EventParam.TO_LAT, to != null ? String.valueOf(to.getLat()) : "N/A")
- .add(Statistics.EventParam.TO_LON, to != null ? String.valueOf(to.getLon()) : "N/A");
-
- String event = isAppInstalled ? Statistics.EventName.ROUTING_TAXI_ORDER
- : Statistics.EventName.ROUTING_TAXI_INSTALL;
- trackEvent(event, location, params.get());
- }
-
- public void trackTaxiEvent(@NonNull String eventName, @NonNull String providerName)
- {
- Statistics.ParameterBuilder params = Statistics.params();
- params.add(Statistics.EventParam.PROVIDER, providerName);
- trackEvent(eventName, params);
- }
-
- public void trackTaxiError(@Nullable TaxiType type, @NonNull TaxiManager.ErrorCode code)
- {
- Statistics.ParameterBuilder params = Statistics.params();
- if (type != null)
- params.add(Statistics.EventParam.PROVIDER, type.getProviderName());
- params.add(ERROR, code.toStatisticValue());
- trackEvent(EventName.ROUTING_TAXI_ROUTE_BUILT, params);
- }
-
- public void trackRestaurantEvent(@NonNull String eventName, @NonNull Sponsored restaurant,
- @NonNull MapObject mapObject)
- {
- String provider = restaurant.getType() == Sponsored.TYPE_OPENTABLE ? OPENTABLE : "Unknown restaurant";
- trackEvent(eventName, LocationHelper.INSTANCE.getLastKnownLocation(),
- Statistics.params().add(PROVIDER, provider)
- .add(RESTAURANT, restaurant.getId())
- .add(RESTAURANT_LAT, mapObject.getLat())
- .add(RESTAURANT_LON, mapObject.getLon()).get());
- }
-
- public void trackHotelEvent(@NonNull String eventName, @NonNull Sponsored hotel,
- @NonNull MapObject mapObject)
- {
- String provider = hotel.getType() == Sponsored.TYPE_BOOKING ? BOOKING_COM : "Unknown hotel";
- trackEvent(eventName, LocationHelper.INSTANCE.getLastKnownLocation(),
- Statistics.params().add(PROVIDER, provider)
- .add(HOTEL, hotel.getId())
- .add(HOTEL_LAT, mapObject.getLat())
- .add(HOTEL_LON, mapObject.getLon()).get());
- }
-
- public void trackBookHotelEvent(@NonNull Sponsored hotel, @NonNull MapObject mapObject)
- {
- trackHotelEvent(PP_SPONSORED_BOOK, hotel, mapObject);
- }
-
- public void trackBookmarksTabEvent(@NonNull String param)
- {
- ParameterBuilder params = params().add(EventParam.VALUE, param);
- trackEvent(EventName.BM_TAB_CLICK, params);
- }
-
- public void trackOpenCatalogScreen()
- {
- trackEvent(EventName.BM_DOWNLOADED_CATALOGUE_OPEN, Collections.emptyMap());
- }
-
- public void trackDownloadCatalogError(@NonNull String value)
- {
- ParameterBuilder params = params().add(EventParam.ERROR, value);
- trackEvent(EventName.BM_DOWNLOADED_CATALOGUE_ERROR, params);
- }
-
- public void trackBookingSearchEvent(@NonNull MapObject mapObject)
- {
- trackEvent(PP_SPONSORED_BOOK, LocationHelper.INSTANCE.getLastKnownLocation(),
- Statistics.params()
- .add(PROVIDER, SEARCH_BOOKING_COM)
- .add(HOTEL, "")
- .add(HOTEL_LAT, mapObject.getLat())
- .add(HOTEL_LON, mapObject.getLon())
- .get());
- }
-
- public void trackDownloaderDialogEvent(@NonNull String eventName, long size)
- {
- trackEvent(eventName, Statistics.params()
- .add(MAP_DATA_SIZE, size));
- }
-
- public void trackDownloaderDialogError(long size, @NonNull String error)
- {
- trackEvent(DOWNLOADER_DIALOG_ERROR, Statistics.params()
- .add(MAP_DATA_SIZE, size)
- .add(TYPE, error));
- }
-
- public void trackPPOwnershipButtonClick(@NonNull MapObject mapObject)
- {
- trackEvent(PP_OWNERSHIP_BUTTON_CLICK, LocationHelper.INSTANCE.getLastKnownLocation(),
- params()
- .add(MWM_NAME, mapObject.getFeatureId().getMwmName())
- .add(MWM_VERSION, mapObject.getFeatureId().getMwmVersion())
- .add(FEATURE_ID, mapObject.getFeatureId().getFeatureIndex())
- .get());
- }
-
- public void trackColdStartupInfo(@NonNull Context context)
- {
- BatteryState.State state = BatteryState.getState(context);
- final String charging;
- switch (state.getChargingStatus())
- {
- case CHARGING_STATUS_UNKNOWN:
- charging = "unknown";
- break;
- case CHARGING_STATUS_PLUGGED:
- charging = ParamValue.ON;
- break;
- case CHARGING_STATUS_UNPLUGGED:
- charging = ParamValue.OFF;
- break;
- default:
- charging = "unknown";
- break;
- }
-
- final String network = getConnectionState();
-
- trackEvent(APPLICATION_COLD_STARTUP_INFO,
- params()
- .add(BATTERY, state.getLevel())
- .add(CHARGING, charging)
- .add(NETWORK, network)
- .get());
- }
-
- @NonNull
- private String getConnectionState()
- {
- final String network;
- if (ConnectionState.INSTANCE.isWifiConnected())
- {
- network = "wifi";
- }
- else if (ConnectionState.INSTANCE.isMobileConnected())
- {
- if (ConnectionState.INSTANCE.isInRoaming())
- network = "roaming";
- else
- network = "mobile";
- }
- else
- {
- network = "off";
- }
- return network;
- }
-
- public void trackSponsoredOpenEvent(@NonNull Sponsored sponsored)
- {
- Statistics.ParameterBuilder builder = Statistics.params();
- builder.add(NETWORK, getConnectionState())
- .add(PROVIDER, convertToSponsor(sponsored));
- trackEvent(PP_SPONSORED_OPEN, builder.get());
- }
-
- public void trackGalleryShown(@NonNull GalleryType type, @NonNull GalleryState state,
- @NonNull GalleryPlacement placement, int itemsCount)
- {
- trackEvent(PP_SPONSORED_SHOWN, Statistics.params()
- .add(PROVIDER, type.getProvider())
- .add(PLACEMENT, placement.toString())
- .add(STATE, state.toString())
- .add(COUNT_LOWERCASE, itemsCount));
- }
-
- public void trackGalleryError(@NonNull GalleryType type,
- @NonNull GalleryPlacement placement, @Nullable String code)
- {
- trackEvent(PP_SPONSORED_ERROR, Statistics.params()
- .add(PROVIDER, type.getProvider())
- .add(PLACEMENT, placement.toString())
- .add(ERROR, code).get());
- }
-
- public void trackGalleryProductItemSelected(@NonNull GalleryType type,
- @NonNull GalleryPlacement placement, int position,
- @NonNull Destination destination)
- {
- trackEvent(PP_SPONSOR_ITEM_SELECTED, Statistics.params()
- .add(PROVIDER, type.getProvider())
- .add(PLACEMENT, placement.toString())
- .add(ITEM, position)
- .add(DESTINATION, destination.toString()));
- }
-
- public void trackGalleryEvent(@NonNull String eventName, @NonNull GalleryType type,
- @NonNull GalleryPlacement placement)
- {
- trackEvent(eventName, Statistics.params()
- .add(PROVIDER, type.getProvider())
- .add(PLACEMENT, placement.toString())
- .get());
- }
-
- public void trackGalleryUserItemShown(@NonNull GalleryType type, @NonNull GalleryState state,
- @NonNull GalleryPlacement placement, int position,
- @NonNull String id)
- {
- trackEvent(PP_SPONSORED_USER_ITEM, Statistics.params()
- .add(PROVIDER, type.getProvider())
- .add(PLACEMENT, placement.toString())
- .add(STATE, state.toString())
- .add(ITEM, position)
- .add(ID, id), STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackSearchPromoCategory(@NonNull String eventName, @NonNull String provider)
- {
- trackEvent(eventName, Statistics.params().add(PROVIDER, provider).get());
- }
-
- public void trackSettingsToggle(boolean value)
- {
- trackEvent(EventName.SETTINGS_TRACKING_TOGGLE, Statistics.params()
- .add(TYPE, ParamValue.CRASH_REPORTS)
- .add(VALUE, value
- ? ParamValue.ON
- : ParamValue.OFF).get());
- }
-
- public void trackSettingsDetails()
- {
- trackEvent(EventName.SETTINGS_TRACKING_DETAILS,
- Statistics.params().add(TYPE, ParamValue.PERSONAL_ADS).get());
- }
-
- @NonNull
- private static String convertToSponsor(@NonNull Sponsored sponsored)
- {
- if (sponsored.getType() == Sponsored.TYPE_PARTNER)
- return sponsored.getPartnerName();
-
- return convertToSponsor(sponsored.getType());
- }
-
- @NonNull
- private static String convertToSponsor(@Sponsored.SponsoredType int type)
- {
- switch (type)
- {
- case Sponsored.TYPE_BOOKING:
- return BOOKING_COM;
- case Sponsored.TYPE_OPENTABLE:
- return OPENTABLE;
- case Sponsored.TYPE_HOLIDAY:
- return HOLIDAY;
- case Sponsored.TYPE_PARTNER:
- return PARTNER;
- case Sponsored.TYPE_PROMO_CATALOG_CITY:
- case Sponsored.TYPE_PROMO_CATALOG_SIGHTSEEINGS:
- case Sponsored.TYPE_PROMO_CATALOG_OUTDOOR:
- return MAPSME_GUIDES;
- case Sponsored.TYPE_NONE:
- return "N/A";
- default:
- throw new AssertionError("Unknown sponsor type: " + type);
- }
- }
-
- public void trackRoutingPoint(@NonNull String eventName, @RoutePointInfo.RouteMarkType int type,
- boolean isPlanning, boolean isNavigating, boolean isMyPosition,
- boolean isApi)
- {
- final String mode;
- if (isNavigating)
- mode = "onroute";
- else if (isPlanning)
- mode = "planning";
- else
- mode = null;
-
- final String method;
- if (isPlanning)
- method = "planning_pp";
- else if (isApi)
- method = "api";
- else
- method = "outside_pp";
-
- ParameterBuilder builder = params()
- .add(TYPE, convertRoutePointType(type))
- .add(VALUE, isMyPosition ? "gps" : "point")
- .add(METHOD, method);
- if (mode != null)
- builder.add(MODE, mode);
- trackEvent(eventName, builder.get());
- }
-
- public void trackRoutingEvent(@NonNull String eventName, boolean isPlanning)
- {
- trackEvent(eventName,
- params()
- .add(MODE, isPlanning ? "planning" : "onroute")
- .get());
- }
-
- public void trackRoutingStart(@Framework.RouterType int type,
- boolean trafficEnabled)
- {
- trackEvent(ROUTING_ROUTE_START, prepareRouteParams(type, trafficEnabled));
- }
-
- public void trackRoutingFinish(boolean interrupted, @Framework.RouterType int type,
- boolean trafficEnabled)
- {
- ParameterBuilder params = prepareRouteParams(type, trafficEnabled);
- trackEvent(ROUTING_ROUTE_FINISH, params.add(INTERRUPTED, interrupted ? 1 : 0));
- }
-
- @NonNull
- private static ParameterBuilder prepareRouteParams(@Framework.RouterType int type,
- boolean trafficEnabled)
- {
- return params().add(MODE, toRouterType(type)).add(TRAFFIC, trafficEnabled ? 1 : 0);
- }
-
- @NonNull
- private static String toRouterType(@Framework.RouterType int type)
- {
- switch (type)
- {
- case Framework.ROUTER_TYPE_VEHICLE:
- return VEHICLE;
- case Framework.ROUTER_TYPE_PEDESTRIAN:
- return PEDESTRIAN;
- case Framework.ROUTER_TYPE_BICYCLE:
- return BICYCLE;
- case Framework.ROUTER_TYPE_TAXI:
- return TAXI;
- case Framework.ROUTER_TYPE_TRANSIT:
- return TRANSIT;
- default:
- throw new AssertionError("Unsupported router type: " + type);
- }
- }
-
- public void trackRoutingTooltipEvent(@RoutePointInfo.RouteMarkType int type,
- boolean isPlanning)
- {
- trackEvent(ROUTING_PLAN_TOOLTIP_CLICK,
- params()
- .add(TYPE, convertRoutePointType(type))
- .add(MODE, isPlanning ? "planning" : "onroute")
- .get());
- }
-
- public void trackSponsoredObjectEvent(@NonNull String eventName, @NonNull Sponsored sponsoredObj,
- @NonNull MapObject mapObject)
- {
- // Here we code category by means of rating.
- trackEvent(eventName, LocationHelper.INSTANCE.getLastKnownLocation(),
- Statistics.params().add(PROVIDER, convertToSponsor(sponsoredObj))
- .add(CATEGORY, sponsoredObj.getRating())
- .add(OBJECT_LAT, mapObject.getLat())
- .add(OBJECT_LON, mapObject.getLon()).get());
- }
-
- @NonNull
- private static String convertRoutePointType(@RoutePointInfo.RouteMarkType int type)
- {
- switch (type)
- {
- case RoutePointInfo.ROUTE_MARK_FINISH:
- return "finish";
- case RoutePointInfo.ROUTE_MARK_INTERMEDIATE:
- return "inter";
- case RoutePointInfo.ROUTE_MARK_START:
- return "start";
- default:
- throw new AssertionError("Wrong parameter 'type'");
- }
- }
-
- @NonNull
- public void trackUGCStart(boolean isEdit, boolean isPPPreview, boolean isFromNotification)
- {
- trackEvent(UGC_REVIEW_START,
- params()
- .add(EventParam.IS_AUTHENTICATED, Framework.nativeIsUserAuthenticated())
- .add(EventParam.IS_ONLINE, ConnectionState.INSTANCE.isConnected())
- .add(EventParam.MODE, isEdit ? ParamValue.EDIT : ParamValue.ADD)
- .add(EventParam.FROM, isPPPreview ? ParamValue.PLACEPAGE_PREVIEW :
- isFromNotification ? ParamValue.NOTIFICATION : ParamValue.PLACEPAGE)
- .get());
- }
-
- public void trackAuthDialogAction(@NonNull String action, @NonNull String value)
- {
- trackEvent(action, params().add(EventParam.FROM, value).get());
- }
-
- public void trackUGCExternalAuthSucceed(@NonNull String provider)
- {
- trackEvent(UGC_AUTH_EXTERNAL_REQUEST_SUCCESS, params().add(EventParam.PROVIDER, provider));
- }
-
- public void trackUGCAuthFailed(@Framework.AuthTokenType int type, @Nullable String error)
- {
- trackEvent(UGC_AUTH_ERROR, params()
- .add(EventParam.PROVIDER, getAuthProvider(type))
- .add(EventParam.ERROR, error)
- .get());
- }
-
- public void trackAuthError(@Framework.AuthTokenType int type, @Nullable String error)
- {
- ParameterBuilder params = params()
- .add(PROVIDER, getAuthProvider(type))
- .add(ERROR, error);
- trackEvent(AUTH_ERROR, params);
- }
-
- public void trackAuthExternalRequestSuccess(int type)
- {
- Map params = Collections.singletonMap(Statistics.EventParam.PROVIDER,
- Statistics.getAuthProvider(type));
- trackEvent(AUTH_EXTERNAL_REQUEST_SUCCESS, params);
- }
-
- public void trackAuthDeclined(int type)
- {
- ParameterBuilder params = params().add(PROVIDER, getAuthProvider(type));
- trackEvent(AUTH_DECLINED, params);
- }
-
- public void trackAuthRequestSuccess(int tokenType)
- {
- Map params = Collections.singletonMap(PROVIDER,
- getAuthProvider(tokenType));
- trackEvent(EventName.AUTH_REQUEST_SUCCESS, params);
- }
-
- public void trackOsmAuthRequestStats(@NonNull String event)
- {
- trackEvent(event, Collections.singletonMap(PROVIDER,
- ParamValue.OSM.toLowerCase()));
- }
-
- @NonNull
- public static String getAuthProvider(@Framework.AuthTokenType int type)
- {
- switch (type)
- {
- case Framework.SOCIAL_TOKEN_GOOGLE:
- return GOOGLE;
- case Framework.SOCIAL_TOKEN_PHONE:
- return PHONE;
- case Framework.TOKEN_MAPSME:
- return MAPSME;
- case Framework.SOCIAL_TOKEN_INVALID:
- return UNKNOWN;
- default:
- throw new AssertionError("Unknown social token type: " + type);
- }
- }
-
- @NonNull
- public static String getSynchronizationType(@BookmarkManager.SynchronizationType int type)
- {
- return type == 0 ? BACKUP : RESTORE;
- }
-
- public void trackQuickFilterOpen(@NonNull String category)
- {
- trackEvent(SEARCH_QUICKFILTER_OPEN, params().add(CATEGORY, category)
- .add(NETWORK, getConnectionState()).get());
- }
-
- public void trackQuickFilterClick(@NonNull String category, @NonNull String name, int count)
- {
- trackEvent(SEARCH_QUICKFILTER_CLICK, params().add(CATEGORY, category).add(name, count).get());
- }
-
- public void trackQuickFilterApply(@NonNull String category, @Nullable String appliedFilters)
- {
- ParameterBuilder builder = params();
- builder.add(CATEGORY, category);
- if (!TextUtils.isEmpty(appliedFilters))
- builder.add(FILTERS, appliedFilters);
- trackEvent(SEARCH_QUICKFILTER_APPLY, builder.get());
- }
-
- public void trackQuickFilterClickError(@NonNull String category, @NonNull String filter,
- @NonNull String error)
- {
- trackEvent(EventName.SEARCH_QUICKFILTER_CLICK_ERROR, params().add(CATEGORY, category)
- .add(FILTER, filter)
- .add(ERROR, error));
- }
-
- public void trackSearchContextAreaClick(@NonNull String value)
- {
- trackEvent(EventName.SEARCH_CONTEXTAREA_CLICK, params().add(VALUE, value));
- }
-
- public void trackFilterEvent(@NonNull String event, @NonNull String category)
- {
- trackEvent(event, params()
- .add(EventParam.CATEGORY, category)
- .get());
- }
-
- public void trackFilterOpenEvent()
- {
- Statistics.INSTANCE.trackEvent(Statistics.EventName.SEARCH_FILTER_OPEN,
- params().add(CATEGORY, HOTEL)
- .add(NETWORK, getConnectionState()).get());
- }
-
- public void trackFilterApplyEvent(@Nullable String appliedFilters)
- {
- ParameterBuilder builder = params();
- if (!TextUtils.isEmpty(appliedFilters))
- builder.add(FILTERS, appliedFilters);
- builder.add(CATEGORY, HOTEL);
- Statistics.INSTANCE.trackEvent(Statistics.EventName.SEARCH_FILTER_APPLY, builder.get());
- }
-
- public void trackFilterClick(@NonNull String category, @NonNull Pair params)
- {
- trackEvent(SEARCH_FILTER_CLICK, params()
- .add(EventParam.CATEGORY, category)
- .add(params.first, params.second)
- .get());
- }
-
- public void trackBmSyncProposalShown(boolean hasAuth)
- {
- trackEvent(BM_SYNC_PROPOSAL_SHOWN, params().add(HAS_AUTH, hasAuth ? 1 : 0).get());
- }
-
- public void trackBmSyncProposalApproved(boolean hasAuth)
- {
- trackEvent(BM_SYNC_PROPOSAL_APPROVED, params()
- .add(HAS_AUTH, hasAuth ? 1 : 0)
- .add(NETWORK, getConnectionState())
- .get());
- }
-
- public void trackBmRestoreProposalClick()
- {
- trackEvent(BM_RESTORE_PROPOSAL_CLICK, params()
- .add(NETWORK, getConnectionState())
- .get());
- }
-
- public void trackBmSyncProposalError(@Framework.AuthTokenType int type, @Nullable String message)
- {
- trackEvent(BM_SYNC_PROPOSAL_ERROR, params()
- .add(PROVIDER, getAuthProvider(type))
- .add(ERROR, message)
- .get());
- }
-
- public void trackBmSettingsToggle(boolean checked)
- {
- trackEvent(BM_SYNC_PROPOSAL_TOGGLE, params()
- .add(STATE, checked ? 1 : 0)
- .get());
- }
-
- public void trackBmSynchronizationFinish(@BookmarkManager.SynchronizationType int type,
- @BookmarkManager.SynchronizationResult int result,
- @NonNull String errorString)
- {
- if (result == BookmarkManager.CLOUD_SUCCESS)
- {
- if (type == BookmarkManager.CLOUD_BACKUP)
- trackEvent(BM_SYNC_SUCCESS);
- else
- trackEvent(BM_RESTORE_PROPOSAL_SUCCESS);
- return;
- }
-
- trackEvent(type == BookmarkManager.CLOUD_BACKUP ? BM_SYNC_ERROR : BM_RESTORE_PROPOSAL_ERROR,
- params().add(TYPE, getTypeForErrorSyncResult(result)).add(ERROR, errorString));
- }
-
- public void trackBmRestoringRequestResult(@BookmarkManager.RestoringRequestResult int result)
- {
- if (result == BookmarkManager.CLOUD_BACKUP_EXISTS)
- return;
-
- trackEvent(BM_RESTORE_PROPOSAL_ERROR, params()
- .add(TYPE, getTypeForRequestRestoringError(result)));
- }
-
- @NonNull
- private static String getTypeForErrorSyncResult(@BookmarkManager.SynchronizationResult int result)
- {
- switch (result)
- {
- case BookmarkManager.CLOUD_AUTH_ERROR:
- return ParamValue.AUTH;
- case BookmarkManager.CLOUD_NETWORK_ERROR:
- return ParamValue.NETWORK;
- case BookmarkManager.CLOUD_DISK_ERROR:
- return ParamValue.DISK;
- case BookmarkManager.CLOUD_USER_INTERRUPTED:
- return ParamValue.USER_INTERRUPTED;
- case BookmarkManager.CLOUD_INVALID_CALL:
- return ParamValue.INVALID_CALL;
- case BookmarkManager.CLOUD_SUCCESS:
- throw new AssertionError("It's not a error result!");
- default:
- throw new AssertionError("Unsupported error type: " + result);
- }
- }
-
- @NonNull
- private static String getTypeForRequestRestoringError(@BookmarkManager.RestoringRequestResult int result)
- {
- switch (result)
- {
- case BookmarkManager.CLOUD_BACKUP_EXISTS:
- throw new AssertionError("It's not a error result!");
- case BookmarkManager.CLOUD_NOT_ENOUGH_DISK_SPACE:
- return DISK_NO_SPACE;
- case BookmarkManager.CLOUD_NO_BACKUP:
- return NO_BACKUP;
- default:
- throw new AssertionError("Unsupported restoring request result: " + result);
- }
- }
-
- public void trackToolbarClick(@NonNull MainMenu.Item button)
- {
- trackEvent(TOOLBAR_CLICK, getToolbarParams(button));
- }
-
- public void trackToolbarMenu(@NonNull MainMenu.Item button)
- {
- trackEvent(TOOLBAR_MENU_CLICK, getToolbarParams(button));
- }
-
- public void trackDownloadBookmarkDialog(@NonNull String button)
- {
- trackEvent(BM_GUIDES_DOWNLOADDIALOGUE_CLICK, params().add(ACTION, button));
- }
-
- @NonNull
- private static ParameterBuilder getToolbarParams(@NonNull MainMenu.Item button)
- {
- return params().add(BUTTON, button.toStatisticValue());
- }
-
- public void trackPPBannerClose(@BannerState int state, boolean isCross)
- {
- trackEvent(PP_BANNER_CLOSE, params().add(BANNER, state)
- .add(BUTTON, isCross ? 0 : 1));
- }
-
- public void trackPurchasePreviewShow(@NonNull String purchaseId, @NonNull String vendor,
- @NonNull String productId, @Nullable String from,
- @Nullable Boolean isTrial)
- {
- ParameterBuilder params = params().add(VENDOR, vendor)
- .add(PRODUCT, productId)
- .add(PURCHASE, purchaseId);
- if (!TextUtils.isEmpty(from))
- params.add(FROM, from);
-
- if (isTrial != null)
- params.add(TRIAL, isTrial);
-
- trackEvent(INAPP_PURCHASE_PREVIEW_SHOW, params,
- STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackPurchasePreviewShow(@NonNull String purchaseId, @NonNull String vendor,
- @NonNull String productId)
- {
- trackPurchasePreviewShow(purchaseId, vendor, productId, null, null);
- }
-
- public void trackPurchaseEvent(@NonNull String event, @NonNull String purchaseId)
- {
- trackPurchaseEvent(event, purchaseId, STATISTICS_CHANNEL_DEFAULT);
- }
-
- public void trackPurchaseEvent(@NonNull String event, @NonNull String purchaseId,
- @StatisticsChannel int channel)
- {
- trackEvent(event, params().add(PURCHASE, purchaseId), channel);
- }
-
- public void trackPurchasePreviewSelect(@NonNull String purchaseId, @NonNull String productId)
- {
- trackPurchasePreviewSelect(purchaseId, productId, null);
- }
-
- public void trackPurchasePreviewSelect(@NonNull String purchaseId, @NonNull String productId,
- @Nullable Boolean isTrial)
- {
- ParameterBuilder params = params();
- if (isTrial != null)
- params.add(TRIAL, isTrial);
- trackEvent(INAPP_PURCHASE_PREVIEW_SELECT, params.add(PRODUCT, productId)
- .add(PURCHASE, purchaseId));
- }
-
- public void trackPurchaseStoreError(@NonNull String purchaseId,
- @BillingClient.BillingResponse int error)
- {
- trackEvent(INAPP_PURCHASE_STORE_ERROR, params().add(ERROR, "Billing error: " + error)
- .add(PURCHASE, purchaseId));
- }
-
- public void trackPurchaseValidationError(@NonNull String purchaseId, @NonNull ValidationStatus status)
- {
- if (status == ValidationStatus.VERIFIED)
- return;
-
- int errorCode;
- switch (status)
- {
- case NOT_VERIFIED:
- errorCode = 0;
- break;
- case AUTH_ERROR:
- errorCode = 1;
- break;
- case SERVER_ERROR:
- errorCode = 2;
- break;
- default:
- throw new UnsupportedOperationException("Unsupported status: " + status);
- }
-
- trackEvent(INAPP_PURCHASE_VALIDATION_ERROR, params().add(ERROR_CODE, errorCode)
- .add(PURCHASE, purchaseId));
- }
-
- public void trackPowerManagmentSchemeChanged(@PowerManagment.SchemeType int scheme)
- {
- String statisticValue = "";
- switch (scheme)
- {
- case PowerManagment.NONE:
- case PowerManagment.MEDIUM:
- throw new AssertionError("Incorrect scheme type");
- case PowerManagment.NORMAL:
- statisticValue = "never";
- break;
- case PowerManagment.AUTO:
- statisticValue = "auto";
- break;
- case PowerManagment.HIGH:
- statisticValue = "max";
- break;
- }
-
- trackEvent(EventName.Settings.ENERGY_SAVING, params().add(EventParam.VALUE, statisticValue));
- }
-
- public void trackPurchaseProductDelivered(@NonNull String purchaseId, @NonNull String vendor)
- {
- trackPurchaseProductDelivered(purchaseId, vendor, null);
- }
-
- public void trackPurchaseProductDelivered(@NonNull String purchaseId, @NonNull String vendor,
- @Nullable Boolean isTrial)
- {
- ParameterBuilder params = params();
- if (isTrial != null)
- params.add(TRIAL, isTrial);
- trackEvent(INAPP_PURCHASE_PRODUCT_DELIVERED, params.add(VENDOR, vendor)
- .add(PURCHASE, purchaseId),
- STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackTipsEvent(@NonNull String eventName, int type)
- {
- trackEvent(eventName, params().add(TYPE, type));
- }
-
- public void trackTipsClose(int type)
- {
- trackEvent(TIPS_TRICKS_CLOSE, params().add(TYPE, type).add(OPTION, OFFSCREEEN));
- }
-
- public void trackGuidesShown(@NonNull String serverIds)
- {
- if (!serverIds.isEmpty())
- trackEvent(GUIDES_SHOWN, params().add(SERVER_IDS, serverIds), STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackGuideOpen(@NonNull String serverId)
- {
- trackEvent(GUIDES_OPEN, params().add(SERVER_ID, serverId), STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackGuideBookmarkSelect(@NonNull String serverId, long catId)
- {
- trackEvent(GUIDES_BOOKMARK_SELECT, params()
- .add(SERVER_ID, serverId)
- .add(FROM, getCompilationTypeById(catId)), STATISTICS_CHANNEL_REALTIME);
- }
-
- @NonNull
- private String getCompilationTypeById(long catId)
- {
- if (!BookmarkManager.INSTANCE.isCompilation(catId))
- return Statistics.ParamValue.MAIN;
- else if (BookmarkManager.INSTANCE.getCompilationType(catId) == BookmarkManager.CATEGORY)
- return Statistics.ParamValue.CATEGORY;
- else
- return Statistics.ParamValue.COLLECTION;
- }
-
- public void trackCollectionOrCategorySelect(@NonNull String serverId, @NonNull String categoryName,
- boolean isCategory)
- {
- String logEventName = isCategory ? BM_BOOKMARKS_LIST_CATEGORY_SELECT :
- BM_BOOKMARKS_LIST_COLLECTION_SELECT;
-
- trackEvent(logEventName, params().add(SERVER_ID, serverId).add(NAME, categoryName),
- STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackGuideVisibilityChange(@NonNull String action, @NonNull String serverId,
- @NonNull String type)
- {
- trackEvent(BM_GUIDE_VISIBILITY_CHANGE, params().add(ACTION, action).add(SERVER_ID, serverId)
- .add(TYPE, type), STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackGuideTrackSelect(@NonNull String serverId)
- {
- trackEvent(GUIDES_TRACK_SELECT, params().add(SERVER_ID, serverId), STATISTICS_CHANNEL_REALTIME);
- }
-
- public void trackDeeplinkEvent(@NonNull String event, @NonNull ParameterBuilder params,
- boolean isFirstLaunch)
- {
- trackEvent(event, params.add(FIRST_LAUNCH, isFirstLaunch ? TRUE : FALSE));
- }
-
- public void trackElevationProfilePageOpen(@Nullable String serverId, @NonNull String state)
- {
- trackEvent(ELEVATION_PROFILE_PAGE_OPEN, params().add(SERVER_ID, serverId).add(STATE, state));
- }
-
- public void trackElevationProfilePageClose(@Nullable String serverId)
- {
- trackEvent(ELEVATION_PROFILE_PAGE_CLOSE, params().add(SERVER_ID, serverId));
- }
-
- @NonNull
- public static ParameterBuilder makeParametersFromType(@NonNull String type)
- {
- return params().add(TYPE, type);
- }
-
- @NonNull
- public static ParameterBuilder makeParametersFromTypeAndUrl(@NonNull String type, @NonNull String url)
- {
- Statistics.ParameterBuilder result = params();
- try
- {
- Uri uri = Uri.parse(url);
- for (String name : uri.getQueryParameterNames())
- {
- if (name.startsWith("utm_") || name.equals("affiliate_id"))
- {
- String value = uri.getQueryParameter(name);
- result.add(name, value == null ? "" : value);
- }
- }
- }
- catch (Exception e)
- {
- CrashlyticsUtils.INSTANCE.logException(new RuntimeException("Failed to parse url: " + url, e));
- }
-
- result.add(TYPE, type);
- return result;
- }
-
- public static ParameterBuilder params()
- {
- return new ParameterBuilder();
- }
-
- public static ParameterBuilder editorMwmParams()
- {
- return params().add(MWM_NAME, Editor.nativeGetMwmName())
- .add(MWM_VERSION, Editor.nativeGetMwmVersion());
- }
-
- public static class ParameterBuilder
- {
- private final Map mParams = new HashMap<>();
-
- @NonNull
- public static ParameterBuilder from(@NonNull String key, @NonNull Analytics analytics)
- {
- return new ParameterBuilder().add(key, analytics.getName());
- }
-
- public ParameterBuilder add(String key, String value)
- {
- mParams.put(key, value);
- return this;
- }
-
- public ParameterBuilder add(String key, boolean value)
- {
- mParams.put(key, String.valueOf(value));
- return this;
- }
-
- public ParameterBuilder add(String key, int value)
- {
- mParams.put(key, String.valueOf(value));
- return this;
- }
-
- public ParameterBuilder add(String key, float value)
- {
- mParams.put(key, String.valueOf(value));
- return this;
- }
-
- public ParameterBuilder add(String key, double value)
- {
- mParams.put(key, String.valueOf(value));
- return this;
- }
-
- public Map get()
- {
- return mParams;
- }
- }
-
- public static String getPointType(MapObject point)
- {
- return MapObject.isOfType(MapObject.MY_POSITION, point) ? Statistics.EventParam.MY_POSITION
- : Statistics.EventParam.POINT;
- }
-
- public enum NetworkErrorType
- {
- NO_NETWORK,
- AUTH_FAILED
- }
-}