зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
effe344f45
Коммит
2bb8a2cfbe
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Загрузка…
Ссылка в новой задаче