2015-08-18 17:37:51 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.deviceevents;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.GregorianCalendar;
|
|
|
|
|
|
|
|
public class GBDeviceEventBatteryInfo extends GBDeviceEvent {
|
2015-08-19 17:36:53 +02:00
|
|
|
public GregorianCalendar lastChargeTime= null;
|
2015-08-18 17:37:51 +02:00
|
|
|
public BatteryState state = BatteryState.UNKNOWN;
|
|
|
|
public short level = 50;
|
|
|
|
public int numCharges = -1;
|
|
|
|
|
|
|
|
public GBDeviceEventBatteryInfo() {
|
|
|
|
eventClass = EventClass.BATTERY_INFO;
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum BatteryState {
|
|
|
|
UNKNOWN,
|
2015-08-21 08:41:57 +02:00
|
|
|
BATTERY_NORMAL,
|
|
|
|
BATTERY_LOW,
|
|
|
|
BATTERY_CHARGING,
|
|
|
|
BATTERY_CHARGING_FULL,
|
|
|
|
BATTERY_NOT_CHARGING_FULL
|
2015-08-18 17:37:51 +02:00
|
|
|
}
|
2015-08-19 17:36:53 +02:00
|
|
|
|
|
|
|
public boolean extendedInfoAvailable() {
|
|
|
|
if (numCharges != -1 && lastChargeTime != null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2015-08-18 17:37:51 +02:00
|
|
|
}
|