diff options
author | 2013-07-05 02:25:08 -0700 | |
---|---|---|
committer | 2013-07-05 02:25:08 -0700 | |
commit | c85efa92bffaceced43d1f9143a9d005473402a5 (patch) | |
tree | 21781b33587def705b6825d0676342ae68daf221 /java/src/com/android/inputmethod/dictionarypack/DictionaryService.java | |
parent | c29acb5b697767d2cf181fcf12c215480e5c6408 (diff) | |
parent | 72c2feb57369527b5f0d2b89505f94503978b928 (diff) | |
download | latinime-c85efa92bffaceced43d1f9143a9d005473402a5.tar.gz latinime-c85efa92bffaceced43d1f9143a9d005473402a5.tar.xz latinime-c85efa92bffaceced43d1f9143a9d005473402a5.zip |
am 72c2feb5: Use TimeUnit instead of DateUtils for readability
* commit '72c2feb57369527b5f0d2b89505f94503978b928':
Use TimeUnit instead of DateUtils for readability
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack/DictionaryService.java')
-rw-r--r-- | java/src/com/android/inputmethod/dictionarypack/DictionaryService.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java b/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java index 3b00723e3..767f895dc 100644 --- a/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java +++ b/java/src/com/android/inputmethod/dictionarypack/DictionaryService.java @@ -22,7 +22,6 @@ import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.IBinder; -import android.text.format.DateUtils; import android.util.Log; import android.widget.Toast; @@ -30,6 +29,7 @@ import com.android.inputmethod.latin.R; import java.util.Locale; import java.util.Random; +import java.util.concurrent.TimeUnit; /** * Service that handles background tasks for the dictionary provider. @@ -77,19 +77,19 @@ public final class DictionaryService extends Service { * How often, in milliseconds, we want to update the metadata. This is a * floor value; actually, it may happen several hours later, or even more. */ - private static final long UPDATE_FREQUENCY = 4 * DateUtils.DAY_IN_MILLIS; + private static final long UPDATE_FREQUENCY = TimeUnit.DAYS.toMillis(4); /** * We are waked around midnight, local time. We want to wake between midnight and 6 am, * roughly. So use a random time between 0 and this delay. */ - private static final int MAX_ALARM_DELAY = 6 * ((int)AlarmManager.INTERVAL_HOUR); + private static final int MAX_ALARM_DELAY = (int)TimeUnit.HOURS.toMillis(6); /** * How long we consider a "very long time". If no update took place in this time, * the content provider will trigger an update in the background. */ - private static final long VERY_LONG_TIME = 14 * DateUtils.DAY_IN_MILLIS; + private static final long VERY_LONG_TIME = TimeUnit.DAYS.toMillis(14); /** * The last seen start Id. This must be stored because we must only call stopSelfResult() with |