jenkins-bot has submitted this change and it was merged.

Change subject: Make sure daily recurring tasks are executed when MainActivity 
is run.
......................................................................


Make sure daily recurring tasks are executed when MainActivity is run.

Right now our recurring tasks are triggered only when PageActivity is
started, which was acceptable in the previous incarnation of the app.
However, we now have MainActivity, with which the user can interact
without ever launching PageActivity, meaning that the recurring tasks
might not get executed.

This can actually mess with our engagement/retention metrics, since one of
the recurring tasks is DailyEventTask, which sends an event that we use to
measure retention.

This patch moves the execution of recurring tasks to the base activity
class, so that the tasks are executed when *any* of our activities is
started, not just PageActivity.

Change-Id: Ic9d41817740a65aac4ade0840efe784b32603b87
---
M app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
M app/src/main/java/org/wikipedia/page/PageActivity.java
2 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Niedzielski: Looks good to me, approved



diff --git 
a/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java 
b/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
index 776b349..0135bea 100644
--- a/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
+++ b/app/src/main/java/org/wikipedia/activity/ThemedActionBarActivity.java
@@ -13,6 +13,7 @@
 import org.wikipedia.R;
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.auth.AccountUtil;
+import org.wikipedia.recurring.RecurringTasksExecutor;
 import org.wikipedia.settings.Prefs;
 
 import java.lang.reflect.Field;
@@ -33,6 +34,9 @@
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
         }
         forceOverflowMenuIcon(this);
+
+        // Conditionally execute all recurring tasks
+        new RecurringTasksExecutor(WikipediaApp.getInstance()).run();
     }
 
     @Override
diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java 
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index f702af3..458dcc5 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -58,7 +58,6 @@
 import org.wikipedia.page.tabs.TabsProvider;
 import org.wikipedia.page.tabs.TabsProvider.TabPosition;
 import org.wikipedia.readinglist.AddToReadingListDialog;
-import org.wikipedia.recurring.RecurringTasksExecutor;
 import org.wikipedia.search.SearchFragment;
 import org.wikipedia.search.SearchInvokeSource;
 import org.wikipedia.search.SearchResultsFragment;
@@ -183,9 +182,6 @@
             // then we must have been launched with an Intent, so... handle it!
             handleIntent(getIntent());
         }
-
-        // Conditionally execute all recurring tasks
-        new RecurringTasksExecutor(app).run();
 
         UserOptionContentResolver.requestManualSync();
     }

-- 
To view, visit https://gerrit.wikimedia.org/r/315686
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic9d41817740a65aac4ade0840efe784b32603b87
Gerrit-PatchSet: 3
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org>
Gerrit-Reviewer: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to