Remove the low battery notification if a normal battery level is reported.

master
Daniele Gobbetti 2017-04-24 09:53:48 +02:00
parent ed02a9781a
commit d570d188a2
2 changed files with 6 additions and 0 deletions

View File

@ -318,6 +318,8 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
context.getString(R.string.notif_battery_low_bigtext_number_of_charges, String.valueOf(deviceEvent.numCharges))
: ""
, context);
} else {
GB.removeBatteryNotification(context);
}
gbDevice.sendDeviceUpdateIntent(context);

View File

@ -365,6 +365,10 @@ public class GB {
updateNotification(notification, NOTIFICATION_ID_LOW_BATTERY, context);
}
public static void removeBatteryNotification(Context context) {
removeNotification(NOTIFICATION_ID_LOW_BATTERY, context);
}
public static GBEnvironment env() {
return environment;
}