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

Commit 6b84ac54 authored by Michael Webster's avatar Michael Webster Committed by Steve Kondik
Browse files

changed some durations, debugged in emu, droid 5.0.7test

parent 5a424701
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -255,12 +255,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>
@@ -269,9 +269,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
@@ -52,6 +52,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;
@@ -295,6 +284,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);
    }