From 089480f3c5d8510dd43fa64eb37b7c76c8c63d6b Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Fri, 29 Jul 2016 09:28:06 -0500 Subject: [PATCH] Report legacy tasker usage --- src/main/java/org/tasks/analytics/Tracking.java | 1 + .../java/org/tasks/receivers/ListNotificationReceiver.java | 5 +++++ src/main/res/values/keys.xml | 1 + 3 files changed, 7 insertions(+) diff --git a/src/main/java/org/tasks/analytics/Tracking.java b/src/main/java/org/tasks/analytics/Tracking.java index a933551fa..5f9165d27 100644 --- a/src/main/java/org/tasks/analytics/Tracking.java +++ b/src/main/java/org/tasks/analytics/Tracking.java @@ -18,6 +18,7 @@ public class Tracking { GTASK_LOGOUT(R.string.tracking_category_google_tasks, R.string.tracking_action_clear), GTASK_MOVE(R.string.tracking_category_google_tasks, R.string.tracking_action_move), UPGRADE(R.string.tracking_category_event, R.string.tracking_event_upgrade), + LEGACY_TASKER_TRIGGER(R.string.tracking_category_event, R.string.tracking_event_legacy_tasker_trigger), NIGHT_MODE_MISMATCH(R.string.tracking_category_event, R.string.tracking_event_night_mode_mismatch), SET_PREFERENCE(R.string.tracking_category_preferences, 0); diff --git a/src/main/java/org/tasks/receivers/ListNotificationReceiver.java b/src/main/java/org/tasks/receivers/ListNotificationReceiver.java index 7ea946f6d..c8ef4d96b 100644 --- a/src/main/java/org/tasks/receivers/ListNotificationReceiver.java +++ b/src/main/java/org/tasks/receivers/ListNotificationReceiver.java @@ -4,6 +4,8 @@ import android.content.Context; import android.content.Intent; import org.tasks.Notifier; +import org.tasks.analytics.Tracker; +import org.tasks.analytics.Tracking; import org.tasks.injection.BroadcastComponent; import org.tasks.injection.InjectingBroadcastReceiver; @@ -23,6 +25,7 @@ public class ListNotificationReceiver extends InjectingBroadcastReceiver { public static final String EXTRA_FILTER_VALUES = "extra_filter_values"; @Inject Notifier notifier; + @Inject Tracker tracker; @Override public void onReceive(Context context, final Intent intent) { @@ -30,6 +33,8 @@ public class ListNotificationReceiver extends InjectingBroadcastReceiver { Timber.i("onReceive(%s, %s)", context, intent); + tracker.reportEvent(Tracking.Events.LEGACY_TASKER_TRIGGER); + executorService.execute(new Runnable() { @Override public void run() { diff --git a/src/main/res/values/keys.xml b/src/main/res/values/keys.xml index f602539b7..3f390ff55 100644 --- a/src/main/res/values/keys.xml +++ b/src/main/res/values/keys.xml @@ -294,6 +294,7 @@ Clear Night Mismatch Upgrade + Legacy Tasker tesla_unread_enabled purchased_tesla_unread purchased_tasker