Bug 823286: Fix incorrect kDefaultRemainingTime value in GeckoBatteryManager.java, to be consistent with dom/battery/Constants.h (and actually use it, instead of hardcoding 0). r=mounir

This commit is contained in:
Daniel Holbert 2012-12-22 10:08:33 -08:00
Родитель effe344f45
Коммит 2bb8a2cfbe
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -21,14 +21,14 @@ public class GeckoBatteryManager extends BroadcastReceiver {
// dom/battery/Constants.h
private final static double kDefaultLevel = 1.0;
private final static boolean kDefaultCharging = true;
private final static double kDefaultRemainingTime = -1.0;
private final static double kDefaultRemainingTime = 0.0;
private final static double kUnknownRemainingTime = -1.0;
private static long sLastLevelChange = 0;
private static boolean sNotificationsEnabled = false;
private static double sLevel = kDefaultLevel;
private static boolean sCharging = kDefaultCharging;
private static double sRemainingTime = kDefaultRemainingTime;;
private static double sRemainingTime = kDefaultRemainingTime;
private static GeckoBatteryManager sInstance = new GeckoBatteryManager();
@ -113,7 +113,7 @@ public class GeckoBatteryManager extends BroadcastReceiver {
}
if (sLevel == 1.0 && sCharging) {
sRemainingTime = 0.0;
sRemainingTime = kDefaultRemainingTime;
} else if (sLevel != previousLevel) {
// Estimate remaining time.
if (sLastLevelChange != 0) {
@ -147,7 +147,7 @@ public class GeckoBatteryManager extends BroadcastReceiver {
} else {
sLevel = kDefaultLevel;
sCharging = kDefaultCharging;
sRemainingTime = 0;
sRemainingTime = kDefaultRemainingTime;
}
/*