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
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 00d3248..3586595 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -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 -->
diff --git a/src/com/android/deskclock/HandleApiCalls.java b/src/com/android/deskclock/HandleApiCalls.java
index 8ff9f8d..0f64c99 100644
--- a/src/com/android/deskclock/HandleApiCalls.java
+++ b/src/com/android/deskclock/HandleApiCalls.java
@@ -386,7 +386,7 @@
                     .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) {
diff --git a/src/com/android/deskclock/timer/TimerReceiver.java b/src/com/android/deskclock/timer/TimerReceiver.java
index 56b9935..595aea0 100644
--- a/src/com/android/deskclock/timer/TimerReceiver.java
+++ b/src/com/android/deskclock/timer/TimerReceiver.java
@@ -295,6 +295,7 @@
         }
 
         if (t.mDeleteAfterUse) {
+            t.setState(TimerObj.STATE_DELETED);
             t.deleteFromSharedPref(prefs);
             Events.sendTimerEvent(R.string.action_delete, R.string.label_notification);
         } else {
@@ -707,16 +708,11 @@
                     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),
-                    addOneMinuteAction)
+                            context.getString(R.string.timer_plus_1_min),
+                            addOneMinuteAction)
                     .setContentTitle(timerObj.getLabelOrDefault(context))
                     .setContentText(context.getString(R.string.timer_times_up));
         }