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

Commit 4eea9fb8 authored by Evan Charlton's avatar Evan Charlton
Browse files

Added the ability for alarm to go off indefinitely.

Alarms can now be set to never stop ringing.

Change-Id: If380498cee78923cff46a215b3b096770d8389b3
parent 02241acd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -267,6 +267,7 @@
      <item>60 minutes</item>
      <item>90 minutes</item>
      <item>120 minutes</item>
      <item>Infinite</item>
    </string-array>

    <!-- Values that are retrieved from the ListPreference. These must match
@@ -278,6 +279,7 @@
      <item>60</item>
      <item>90</item>
      <item>120</item>
      <item>-1</item>
    </string-array>

    <!-- Setting title for setting alarm time limit -->
+6 −4
Original line number Diff line number Diff line
@@ -291,11 +291,13 @@ public class AlarmKlaxon extends Service {
    	
    	int alarmtimeout = Integer.parseInt(alarmdur);

        if (alarmtimeout > 0) {
            final int ALARM_TIMEOUT_SECONDS = alarmtimeout * 60;

            mHandler.sendMessageDelayed(mHandler.obtainMessage(KILLER, alarm),
                    1000 * ALARM_TIMEOUT_SECONDS);
        }
    }

    private void disableKiller() {
        mHandler.removeMessages(KILLER);