OSDN Git Service

SettingsLib: the time is wrong in battery info view.
authoryumeng <yumeng@codeaurora.org>
Tue, 30 Aug 2016 02:10:36 +0000 (10:10 +0800)
committerGerrit - the friendly Code Review server <code-review@localhost>
Wed, 7 Sep 2016 10:44:23 +0000 (03:44 -0700)
show the positive time in Math method.

Change-Id: I78fe3a1128494fb2822cfa0c5326d20ad33ab374
CRs-Fixed: 991999

packages/SettingsLib/src/com/android/settingslib/BatteryInfo.java

index fa1f91f..0edd1c6 100644 (file)
@@ -86,7 +86,7 @@ public class BatteryInfo {
         parse(mStats, remainingTimeUs, parserList);
         final Context context = view.getContext();
         String timeString = context.getString(R.string.charge_length_format,
-                Formatter.formatShortElapsedTime(context, timePeriod));
+                Formatter.formatShortElapsedTime(context, Math.abs(timePeriod)));
         String remaining = "";
         if (remainingTimeUs != 0) {
             remaining = context.getString(R.string.remaining_length_format,