Skip to content

Commit

Permalink
Remove alarms when Red Moon is disabled
Browse files Browse the repository at this point in the history
See #29

Red Moon will no longer startup on the set times if it is disabled (the
switch in the app bar is off).
  • Loading branch information
raatmarien committed Apr 6, 2016
1 parent 35ba781 commit 1af65a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,7 @@ public void setSwitchOn(boolean powerState, boolean pauseState) {
setPreferencesEnabled();
}

Log.d(TAG, powerState + " " + pauseState);
if (powerState && !pauseState) {
Log.d(TAG, "warning toast");
activity.displayInstallWarningToast();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ public void sendCommand(int command) {
@Override
public void onShadesPowerStateChanged(boolean powerState) {
setShadesFabIcon(powerState, mSettingsModel.getShadesPauseState());

if (!powerState) {
AutomaticFilterChangeReceiver.cancelAlarms(mContext);
} else {
AutomaticFilterChangeReceiver.cancelAlarms(mContext);
AutomaticFilterChangeReceiver.scheduleNextOnCommand(mContext);
AutomaticFilterChangeReceiver.scheduleNextPauseCommand(mContext);
}
}

@Override
Expand Down

0 comments on commit 1af65a1

Please sign in to comment.