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

Change subject: Hygiene: use TimeUnit instead of arithmetic
......................................................................


Hygiene: use TimeUnit instead of arithmetic

Change-Id: Ifca43a277058c1f58026a39b3d93b05edd28c1a7
---
M app/src/main/java/org/wikipedia/RemoteConfigRefreshTask.java
M app/src/main/java/org/wikipedia/alphaupdater/AlphaUpdateChecker.java
M app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java
3 files changed, 6 insertions(+), 4 deletions(-)

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



diff --git a/app/src/main/java/org/wikipedia/RemoteConfigRefreshTask.java 
b/app/src/main/java/org/wikipedia/RemoteConfigRefreshTask.java
index 7f6b7f1..eb64827 100644
--- a/app/src/main/java/org/wikipedia/RemoteConfigRefreshTask.java
+++ b/app/src/main/java/org/wikipedia/RemoteConfigRefreshTask.java
@@ -7,6 +7,7 @@
 import org.wikipedia.util.log.L;
 
 import java.util.Date;
+import java.util.concurrent.TimeUnit;
 
 import okhttp3.Request;
 import okhttp3.Response;
@@ -15,8 +16,7 @@
     // Switch over to production when it is available
     private static final java.lang.String REMOTE_CONFIG_URL = 
"https://meta.wikimedia.org/static/current/extensions/MobileApp/config/android.json";;
 
-    // The 'l' suffix is needed because stupid Java overflows constants 
otherwise
-    private static final long RUN_INTERVAL_MILLI = 24L * 60L * 60L * 1000L; // 
Once a day!
+    private static final long RUN_INTERVAL_MILLI = TimeUnit.DAYS.toMillis(1);
 
     @Override
     protected boolean shouldRun(Date lastRun) {
diff --git 
a/app/src/main/java/org/wikipedia/alphaupdater/AlphaUpdateChecker.java 
b/app/src/main/java/org/wikipedia/alphaupdater/AlphaUpdateChecker.java
index 6198081..3eefd1d 100644
--- a/app/src/main/java/org/wikipedia/alphaupdater/AlphaUpdateChecker.java
+++ b/app/src/main/java/org/wikipedia/alphaupdater/AlphaUpdateChecker.java
@@ -18,12 +18,13 @@
 
 import java.io.IOException;
 import java.util.Date;
+import java.util.concurrent.TimeUnit;
 
 import okhttp3.Request;
 import okhttp3.Response;
 
 public class AlphaUpdateChecker extends RecurringTask {
-    private static final long RUN_INTERVAL_MILLI = 24L * 60L * 60L * 1000L; // 
Once a day!
+    private static final long RUN_INTERVAL_MILLI = TimeUnit.DAYS.toMillis(1);
 
     private static final String PREFERENCE_KEY_ALPHA_COMMIT = 
"alpha_last_checked_commit";
     private static final String ALPHA_BUILD_APK_URL = 
"https://android-builds.wmflabs.org/runs/latest/wikipedia.apk";;
diff --git 
a/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java 
b/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java
index c1bb664..421c752 100644
--- a/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java
+++ b/app/src/main/java/org/wikipedia/page/snippet/SharedImageCleanupTask.java
@@ -9,13 +9,14 @@
 
 import java.io.File;
 import java.util.Date;
+import java.util.concurrent.TimeUnit;
 
 /**
  * Mainly to clean up images shared through SnippetShareAdapter.
  */
 public class SharedImageCleanupTask extends RecurringTask {
 
-    private static final long RUN_INTERVAL_MILLI = 24L * 60L * 60L * 1000L;
+    private static final long RUN_INTERVAL_MILLI = TimeUnit.DAYS.toMillis(1);
     @NonNull private final Context context;
 
     public SharedImageCleanupTask(Context context) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifca43a277058c1f58026a39b3d93b05edd28c1a7
Gerrit-PatchSet: 2
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Brion VIBBER <br...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@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