Fixed bug, when Live Updates switch state was ignored when downloading Live Updates after settings dialog closed.
This commit is contained in:
parent
c06c224e73
commit
c04267b58a
1 changed files with 2 additions and 3 deletions
|
@ -128,9 +128,7 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
if (liveUpdatePreference.get() != liveUpdatesSwitch.isChecked()) {
|
if (liveUpdatePreference.get() != liveUpdatesSwitch.isChecked()) {
|
||||||
liveUpdatePreference.set(liveUpdatesSwitch.isChecked());
|
liveUpdatePreference.set(liveUpdatesSwitch.isChecked());
|
||||||
if (liveUpdatesSwitch.isChecked()) {
|
if (!liveUpdatesSwitch.isChecked()) {
|
||||||
runLiveUpdate(localIndexInfo, false);
|
|
||||||
} else {
|
|
||||||
long updatesSize = changesManager.getUpdatesSize(fileNameWithoutExtension);
|
long updatesSize = changesManager.getUpdatesSize(fileNameWithoutExtension);
|
||||||
if (updatesSize != 0) {
|
if (updatesSize != 0) {
|
||||||
ClearUpdatesDialogFragment.createInstance(localIndexInfo)
|
ClearUpdatesDialogFragment.createInstance(localIndexInfo)
|
||||||
|
@ -151,6 +149,7 @@ public class LiveUpdatesSettingsDialogFragment extends DialogFragment {
|
||||||
timeOfDayPreference.set(timeOfDayInt);
|
timeOfDayPreference.set(timeOfDayInt);
|
||||||
|
|
||||||
if (liveUpdatesSwitch.isChecked() && getSettings().IS_LIVE_UPDATES_ON.get()) {
|
if (liveUpdatesSwitch.isChecked() && getSettings().IS_LIVE_UPDATES_ON.get()) {
|
||||||
|
runLiveUpdate(localIndexInfo, false);
|
||||||
UpdateFrequency updateFrequency = UpdateFrequency.values()[updateFrequencyInt];
|
UpdateFrequency updateFrequency = UpdateFrequency.values()[updateFrequencyInt];
|
||||||
TimeOfDay timeOfDayToUpdate = TimeOfDay.values()[timeOfDayInt];
|
TimeOfDay timeOfDayToUpdate = TimeOfDay.values()[timeOfDayInt];
|
||||||
setAlarmForPendingIntent(alarmIntent, alarmMgr, updateFrequency, timeOfDayToUpdate);
|
setAlarmForPendingIntent(alarmIntent, alarmMgr, updateFrequency, timeOfDayToUpdate);
|
||||||
|
|
Loading…
Reference in a new issue