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

Commit 8ddfc078 authored by Michael Webster's avatar Michael Webster
Browse files

changed some durations, debugged in emu, droid 5.0.7test

parent 849c3eeb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -254,12 +254,12 @@
    <!-- Setting title for setting alarm time limit -->
    <string name="alarm_limit_title">Maximum alarm duration</string>

    <!-- Entries listed in the ListPreference when invoking the snooze duration
    <!-- Entries listed in the ListPreference when invoking the max alarm duration
         preference. -->
    <string-array name="alarm_limit_entries">
      <item>5 minutes</item>
      <item>15 minutes</item>
      <item>30 minutes</item>
      <item>45 minutes</item>
      <item>60 minutes</item>
      <item>90 minutes</item>
      <item>120 minutes</item>
@@ -268,9 +268,9 @@
    <!-- Values that are retrieved from the ListPreference. These must match
         the alarm_limit_entries above. -->
    <string-array name="alarm_limit_values">
      <item>5</item>
      <item>15</item>
      <item>30</item>
      <item>45</item>
      <item>60</item>
      <item>90</item>
      <item>120</item>
+2 −1
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@
		android:title="@string/alarm_limit_title"
        android:entries="@array/alarm_limit_entries"
        android:entryValues="@array/alarm_limit_values"
        android:defaultValue="30" />
        android:defaultValue="30" 
        android:dialogTitle="@string/alarm_limit_title"/>
		
</PreferenceScreen>
+9 −11
Original line number Diff line number Diff line
@@ -41,20 +41,9 @@ import android.telephony.TelephonyManager;
 */
public class AlarmKlaxon extends Service {

    /** Play alarm up to 10 minutes before silencing */
/**    private static final int ALARM_TIMEOUT_SECONDS = 30 * 60; */
	
	private static final String DEFAULT_ALARM_LIMIT = "30";
	
	final String alarmdur =
        PreferenceManager.getDefaultSharedPreferences(this)
        .getString(SettingsActivity.KEY_ALARM_LIMIT, DEFAULT_ALARM_LIMIT);

	int alarmtimeout = Integer.parseInt(alarmdur);
		
	private final int ALARM_TIMEOUT_SECONDS = alarmtimeout * 60;
	

    private static final long[] sVibratePattern = new long[] { 500, 500 };

    private boolean mPlaying = false;
@@ -292,6 +281,15 @@ public class AlarmKlaxon extends Service {
     * popped, so the user will know that the alarm tripped.
     */
    private void enableKiller(Alarm alarm) {

    	final String alarmdur =
            PreferenceManager.getDefaultSharedPreferences(this)
            .getString(SettingsActivity.KEY_ALARM_LIMIT, DEFAULT_ALARM_LIMIT);
    	
    	int alarmtimeout = Integer.parseInt(alarmdur);

    	final int ALARM_TIMEOUT_SECONDS = alarmtimeout * 60;
    	
        mHandler.sendMessageDelayed(mHandler.obtainMessage(KILLER, alarm),
                1000 * ALARM_TIMEOUT_SECONDS);
    }