Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2241bd78 authored by Michael W's avatar Michael W
Browse files

DeskClock: Stop editing time when pausing the app

* Currently adding a new alarm, pausing the app and then resuming it
  can lead to an existing alarm being changed
* Instead of relying on stored values or the user even remembering which
  alarm he edited (or wanted to add) last, close the picker

Reproduction:
- Expand an alarm
- Press FAB
- Lock device and unlock again
- Press OK in the picker - last expanded alarm is edited instead of
  a new one being created

Fixes: https://gitlab.com/LineageOS/issues/android/-/issues/5035
Change-Id: Id38071a5726227cc91d881de18551b956cef3328
parent 29e4b237
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -243,6 +243,10 @@ public final class AlarmClockFragment extends DeskClockFragment implements
        // home was pressed, just dismiss any existing toast bar when restarting
        // the app.
        mAlarmUpdateHandler.hideUndoBar();

        // Don't show the picker after resuming, so we don't need to remember what time we edited
        // last (and the user maybe also doesn't remember then, editing the wrong alarm)
        TimePickerDialogFragment.removeTimeEditDialog(getChildFragmentManager());
    }

    @Override