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

Commit 0f69521d authored by Annie Chin's avatar Annie Chin
Browse files

Improve handling for deleteAfterUse timers.

Bug: 24515248

Do not differentiate notification "stop" action for non-deleteAfterUse
and deleteAfterUse timers.
Set timerObj state to STATE_DELETED when deleteAfterUse timer is
stopped.

Change-Id: I33ee021311134b1b120bbf7f793c45d013a8740d
parent f23f260e
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -524,8 +524,6 @@
    <string name="timer_stop">Stop</string>
    <!-- Describes the purpose of the button to stop all currently firing timers. [CHAR LIMIT=25] -->
    <string name="timer_stop_all">Stop all timers</string>
    <!-- Describes the purpose of the button to stop and delete the timer. -->
    <string name="timer_done">Done</string>
    <!-- Describes the purpose of the button to return the timer to it's original starting value. -->
    <string name="timer_reset">Reset</string>
    <!-- Describes the purpose of the button to discard the current dialog values. Will also close the dialog if other time's exist -->
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ public class HandleApiCalls extends Activity {
                    .putExtra(Timers.SCROLL_TO_TIMER_ID, timer.mTimerId));
        }
        Voice.notifySuccess(this, getString(R.string.timer_created));
        LogUtils.i("HandleApiCalls timer created: %s", timer);
        LogUtils.i("HandleApiCalls timer created: %s id %d", timer, timer.mTimerId);
    }

    private void setupInstance(AlarmInstance instance, boolean skipUi) {
+4 −8
Original line number Diff line number Diff line
@@ -295,6 +295,7 @@ public class TimerReceiver extends BroadcastReceiver {
        }

        if (t.mDeleteAfterUse) {
            t.setState(TimerObj.STATE_DELETED);
            t.deleteFromSharedPref(prefs);
            Events.sendTimerEvent(R.string.action_delete, R.string.label_notification);
        } else {
@@ -707,12 +708,7 @@ public class TimerReceiver extends BroadcastReceiver {
                    PendingIntent.FLAG_UPDATE_CURRENT);

            // If only one timer is firing, add the +1 button
            builder.addAction(timerObj.getDeleteAfterUse()
                                    ? android.R.drawable.ic_menu_close_clear_cancel
                                    : R.drawable.ic_stop_24dp,
                            timerObj.getDeleteAfterUse()
                                    ? context.getString(R.string.timer_done)
                                    : context.getString(R.string.timer_stop),
            builder.addAction(R.drawable.ic_stop_24dp, context.getString(R.string.timer_stop),
                            stopIntent)
                    .addAction(R.drawable.ic_add_24dp,
                            context.getString(R.string.timer_plus_1_min),