From 5693274d2a374deb4e3adcc70136ceddaf914b15 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 11 Jun 2015 13:43:38 -0700 Subject: Always round migration times up to 1 second. Bug: 21755250 Change-Id: I4e5eef493f2f923d0bcf110133e862c4a4a7db8b --- src/com/android/settings/deviceinfo/MigrateEstimateTask.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/settings/deviceinfo/MigrateEstimateTask.java b/src/com/android/settings/deviceinfo/MigrateEstimateTask.java index bc8ff92..34a44ac 100644 --- a/src/com/android/settings/deviceinfo/MigrateEstimateTask.java +++ b/src/com/android/settings/deviceinfo/MigrateEstimateTask.java @@ -104,6 +104,7 @@ public abstract class MigrateEstimateTask extends AsyncTask im protected void onPostExecute(Long result) { mSizeBytes = result; mTimeMillis = (mSizeBytes * DateUtils.SECOND_IN_MILLIS) / SPEED_ESTIMATE_BPS; + mTimeMillis = Math.max(mTimeMillis, DateUtils.SECOND_IN_MILLIS); final String size = Formatter.formatFileSize(mContext, mSizeBytes); final String time = DateUtils.formatDuration(mTimeMillis).toString(); -- cgit v1.1