diff options
author | 2013-07-05 17:57:01 +0900 | |
---|---|---|
committer | 2013-07-05 17:57:01 +0900 | |
commit | 72c2feb57369527b5f0d2b89505f94503978b928 (patch) | |
tree | f239b38e5f84376573b568eae39f1bc5364fd46b /java/src/com/android/inputmethod/dictionarypack | |
parent | cb13d11c0af95b0621c012be9c01e04a463e40c5 (diff) | |
download | latinime-72c2feb57369527b5f0d2b89505f94503978b928.tar.gz latinime-72c2feb57369527b5f0d2b89505f94503978b928.tar.xz latinime-72c2feb57369527b5f0d2b89505f94503978b928.zip |
Use TimeUnit instead of DateUtils for readability
Bug: 9550800
Change-Id: I087205530a5dbcff4bf08f48f4aa7068aae93215
Diffstat (limited to 'java/src/com/android/inputmethod/dictionarypack')
-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 |