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

Commit 07c17cb1 authored by James Lemieux's avatar James Lemieux Committed by Android (Google) Code Review
Browse files

Merge "Do not attempt to display deleted timer" into ub-deskclock-dazzle

parents a34fe5c8 692ccc4a
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -210,11 +210,14 @@ public class HandleDeskClockApiCalls extends Activity {
            if (timer == null) {
                Voice.notifyFailure(this, reason);
            } else {
                timerId = timer.getId();

                // Otherwise the control command can be honored.
                switch (action) {
                    case ACTION_RESET_TIMER: {
                        DataModel.getDataModel().resetOrDeleteTimer(timer, eventLabel);
                        if (timer.isExpired() && timer.getDeleteAfterUse()) {
                            timerId = -1;
                            reason = getString(R.string.timer_deleted);
                        } else {
                            reason = getString(R.string.timer_was_reset);
@@ -237,7 +240,6 @@ public class HandleDeskClockApiCalls extends Activity {
                        throw new IllegalArgumentException("unknown timer action: " + action);
                }

                timerId = timer.getId();
                Voice.notifySuccess(this, reason);
            }

@@ -245,10 +247,12 @@ public class HandleDeskClockApiCalls extends Activity {
        }

        // Open the UI to the timers.
        final Intent timerIntent = new Intent(mAppContext, DeskClock.class)
                .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX)
                .putExtra(EXTRA_TIMER_ID, timerId);
        startActivity(timerIntent);
        final Intent showTimers = new Intent(mAppContext, DeskClock.class)
                .putExtra(DeskClock.SELECT_TAB_INTENT_EXTRA, DeskClock.TIMER_TAB_INDEX);
        if (timerId != -1) {
            showTimers.putExtra(EXTRA_TIMER_ID, timerId);
        }
        startActivity(showTimers);
    }

    private void handleClockIntent(Intent intent) {