mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-09-01 12:05:37 +02:00
Add getBatteryPollingIntervalMinutes to DevicePrefs
This commit is contained in:
parent
953d26ed71
commit
7e0e3fa661
@ -2044,8 +2044,8 @@ public class HuaweiSupportProvider {
|
||||
}
|
||||
|
||||
public boolean startBatteryRunnerDelayed() {
|
||||
String interval_minutes = GBApplication.getDeviceSpecificSharedPrefs(deviceMac).getString(DeviceSettingsPreferenceConst.PREF_BATTERY_POLLING_INTERVAL, "15");
|
||||
int interval = Integer.parseInt(interval_minutes) * 60 * 1000;
|
||||
int interval_minutes = GBApplication.getDevicePrefs(deviceMac).getBatteryPollingIntervalMinutes();
|
||||
int interval = interval_minutes * 60 * 1000;
|
||||
LOG.debug("Starting battery runner delayed by {} ({} minutes)", interval, interval_minutes);
|
||||
handler.removeCallbacks(batteryRunner);
|
||||
return handler.postDelayed(batteryRunner, interval);
|
||||
|
@ -32,6 +32,10 @@ public class DevicePrefs extends Prefs {
|
||||
return getInt(PREF_BATTERY_NOTIFY_FULL_THRESHOLD + batteryConfig.getBatteryIndex(), batteryConfig.getDefaultFullThreshold());
|
||||
}
|
||||
|
||||
public int getBatteryPollingIntervalMinutes() {
|
||||
return getInt(PREF_BATTERY_POLLING_INTERVAL, 15);
|
||||
}
|
||||
|
||||
public boolean getFetchUnknownFiles() {
|
||||
return getBoolean("fetch_unknown_files", false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user