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

Commit d62917cb authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Stop ringtone after timer deletion

Bug: 10451666
Change-Id: I4a53958aafa46e87ba0471d5d9090f7afe16f6fe
parent 8d1e8e42
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -738,6 +738,7 @@ public class TimerFragment extends DeskClockFragment
                // Tell receiver the timer was deleted.
                // It will stop all activity related to the
                // timer
                t.mState = TimerObj.STATE_DELETED;
                updateTimersState(t, Timers.DELETE_TIMER);
                break;
            case ClickAction.ACTION_PLUS_ONE:
@@ -820,6 +821,7 @@ public class TimerFragment extends DeskClockFragment
                    // Tell receiver the timer was deleted.
                    // It will stop all activity related to the
                    // timer
                    t.mState = TimerObj.STATE_DELETED;
                    updateTimersState(t, Timers.DELETE_TIMER);
                }
                break;
@@ -968,9 +970,7 @@ public class TimerFragment extends DeskClockFragment
    }

    private void updateTimersState(TimerObj t, String action) {
        if (!Timers.DELETE_TIMER.equals(action)) {
        t.writeToSharedPref(mPrefs);
        }
        Intent i = new Intent();
        i.setAction(action);
        i.putExtra(Timers.TIMER_INTENT_EXTRA, t.mTimerId);
+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class TimerObj implements Parcelable {
    public static final int STATE_TIMESUP = 3;
    public static final int STATE_DONE = 4;
    public static final int STATE_RESTART = 5;
    public static final int STATE_DELETED = 6;

    private static final String PREF_TIMER_ID = "timer_id_";
    private static final String PREF_START_TIME  = "timer_start_time_";