Merge commit '37513df'

pull/14/head
Tim Su 13 years ago
commit 94707800ac

@ -226,13 +226,18 @@ public class Notifications extends BroadcastReceiver {
boolean voiceReminder = Preferences.getBoolean(R.string.p_voiceRemindersEnabled, false); boolean voiceReminder = Preferences.getBoolean(R.string.p_voiceRemindersEnabled, false);
// if multi-ring is activated, set up the flags for insistent // if multi-ring is activated and the setting p_rmd_maxvolume allows it, set up the flags for insistent
// notification, and increase the volume to full volume, so the user // notification, and increase the volume to full volume, so the user
// will actually pay attention to the alarm // will actually pay attention to the alarm
if(ringTimes != 1 && (type != ReminderService.TYPE_RANDOM)) { boolean maxOutVolumeForMultipleRingReminders = Preferences.getBoolean(R.string.p_rmd_maxvolume, true);
// remember it to set it to the old value after the alarm
int previousAlarmVolume = audioManager.getStreamVolume(AudioManager.STREAM_ALARM);
if (ringTimes != 1 && (type != ReminderService.TYPE_RANDOM)) {
notification.audioStreamType = AudioManager.STREAM_ALARM; notification.audioStreamType = AudioManager.STREAM_ALARM;
audioManager.setStreamVolume(AudioManager.STREAM_ALARM, if (maxOutVolumeForMultipleRingReminders) {
audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM), 0); audioManager.setStreamVolume(AudioManager.STREAM_ALARM,
audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM), 0);
}
// insistent rings until notification is disabled // insistent rings until notification is disabled
if(ringTimes < 0) { if(ringTimes < 0) {
@ -251,7 +256,7 @@ public class Notifications extends BroadcastReceiver {
voiceReminder = false; voiceReminder = false;
} else { } else {
String notificationPreference = Preferences.getStringValue(R.string.p_rmd_ringtone); String notificationPreference = Preferences.getStringValue(R.string.p_rmd_ringtone);
if(audioManager.getStreamVolume(AudioManager.STREAM_RING) == 0) { if(audioManager.getStreamVolume(AudioManager.STREAM_NOTIFICATION) == 0) {
notification.sound = null; notification.sound = null;
voiceReminder = false; voiceReminder = false;
} else if(notificationPreference != null) { } else if(notificationPreference != null) {
@ -288,7 +293,7 @@ public class Notifications extends BroadcastReceiver {
AndroidUtilities.sleepDeep(500); AndroidUtilities.sleepDeep(500);
} }
if (voiceReminder) { if (voiceReminder || maxOutVolumeForMultipleRingReminders) {
AndroidUtilities.sleepDeep(2000); AndroidUtilities.sleepDeep(2000);
for(int i = 0; i < 50; i++) { for(int i = 0; i < 50; i++) {
AndroidUtilities.sleepDeep(500); AndroidUtilities.sleepDeep(500);
@ -296,7 +301,11 @@ public class Notifications extends BroadcastReceiver {
break; break;
} }
try { try {
VoiceOutputService.getVoiceOutputInstance().queueSpeak(text); // first reset the Alarm-volume to the value before it was eventually maxed out
if (maxOutVolumeForMultipleRingReminders)
audioManager.setStreamVolume(AudioManager.STREAM_ALARM, previousAlarmVolume, 0);
if (voiceReminder)
VoiceOutputService.getVoiceOutputInstance().queueSpeak(text);
} catch (VerifyError e) { } catch (VerifyError e) {
// unavailable // unavailable
} }

@ -68,6 +68,11 @@ public class ReminderPreferences extends TodorooPreferenceActivity {
preference.setSummary(r.getString(R.string.rmd_EPr_persistent_desc_true)); preference.setSummary(r.getString(R.string.rmd_EPr_persistent_desc_true));
else else
preference.setSummary(r.getString(R.string.rmd_EPr_persistent_desc_false)); preference.setSummary(r.getString(R.string.rmd_EPr_persistent_desc_false));
} else if(r.getString(R.string.p_rmd_maxvolume).equals(preference.getKey())) {
if((Boolean)value)
preference.setSummary(r.getString(R.string.rmd_EPr_multiple_maxvolume_desc_true));
else
preference.setSummary(r.getString(R.string.rmd_EPr_multiple_maxvolume_desc_false));
} else if(r.getString(R.string.p_rmd_vibrate).equals(preference.getKey())) { } else if(r.getString(R.string.p_rmd_vibrate).equals(preference.getKey())) {
if((Boolean)value) if((Boolean)value)
preference.setSummary(r.getString(R.string.rmd_EPr_vibrate_desc_true)); preference.setSummary(r.getString(R.string.rmd_EPr_vibrate_desc_true));

@ -1472,12 +1472,19 @@ Achtung: diese Aufgaben sind unwiederbringlich verloren, wenn Sie kein Backup ge
<!-- Reminder Preference: Notification Icon Description --> <!-- Reminder Preference: Notification Icon Description -->
<string name="rmd_Epr_notificon_desc">Astrid\'s Notification Bar Icon auswählen</string> <string name="rmd_Epr_notificon_desc">Astrid\'s Notification Bar Icon auswählen</string>
<!-- Reminder Preference: Max Volume for Multiple-Ring reminders Title -->
<string name="rmd_EPr_multiple_maxvolume_title">Lautstärke hoch bei wdh. Alarm</string>
<!-- Reminder Preference: Max Volume for Multiple-Ring reminders Description (true) -->
<string name="rmd_EPr_multiple_maxvolume_desc_true">Astrid wird bei mehrfach alarmierenden Aufgaben laut sein</string>
<!-- Reminder Preference: Max Volume for Multiple-Ring reminders Description (false) -->
<string name="rmd_EPr_multiple_maxvolume_desc_false">Astrid verwendet die Lautstärke der Systemeinstellung</string>
<!-- Reminder Preference: Vibrate Title --> <!-- Reminder Preference: Vibrate Title -->
<string name="rmd_EPr_vibrate_title">Vibrieren beim Alarm</string> <string name="rmd_EPr_vibrate_title">Vibrieren beim Alarm</string>
<!-- Reminder Preference: Vibrate Description (true) --> <!-- Reminder Preference: Vibrate Description (true) -->
<string name="rmd_EPr_vibrate_desc_true">Astrid wird bei Benachrichtigungen vibrieren</string> <string name="rmd_EPr_vibrate_desc_true">Astrid wird bei Benachrichtigungen vibrieren</string>
<!-- Reminder Preference: Vibrate Description (false) --> <!-- Reminder Preference: Vibrate Description (false) -->
<string name="rmd_EPr_vibrate_desc_false">Astrid wird bei Erinnerungen nicht vibrieren</string> <string name="rmd_EPr_vibrate_desc_false">Astrid wird bei Benachrichtigungen nicht vibrieren</string>
<!-- Reminder Preference: Nagging Title --> <!-- Reminder Preference: Nagging Title -->
<string name="rmd_EPr_nagging_title">Astrid Ermutigungen</string> <string name="rmd_EPr_nagging_title">Astrid Ermutigungen</string>

@ -19,6 +19,9 @@
<!-- whether "clear all notifications" clears astrid notifications --> <!-- whether "clear all notifications" clears astrid notifications -->
<string name="p_rmd_persistent">notif_annoy</string> <string name="p_rmd_persistent">notif_annoy</string>
<!-- whether to max out the notification reminder volume if reminder has setting "ring multiple" or "ring continuous" -->
<string name="p_rmd_maxvolume">notif_maxvol</string>
<!-- whether to vibrate phone when reminder fires --> <!-- whether to vibrate phone when reminder fires -->
<string name="p_rmd_vibrate">notif_vibrate</string> <string name="p_rmd_vibrate">notif_vibrate</string>

@ -97,6 +97,13 @@
<!-- Reminder Preference: Notification Icon Description --> <!-- Reminder Preference: Notification Icon Description -->
<string name="rmd_Epr_notificon_desc">Choose Astrid\'s notification bar icon</string> <string name="rmd_Epr_notificon_desc">Choose Astrid\'s notification bar icon</string>
<!-- Reminder Preference: Max Volume for Multiple-Ring reminders Title -->
<string name="rmd_EPr_multiple_maxvolume_title">Max volume for multiple-ring reminders</string>
<!-- Reminder Preference: Max Volume for Multiple-Ring reminders Description (true) -->
<string name="rmd_EPr_multiple_maxvolume_desc_true">Astrid will max out the volume for multiple-ring reminders</string>
<!-- Reminder Preference: Max Volume for Multiple-Ring reminders Description (false) -->
<string name="rmd_EPr_multiple_maxvolume_desc_false">Astrid will use the system-setting for the volume</string>
<!-- Reminder Preference: Vibrate Title --> <!-- Reminder Preference: Vibrate Title -->
<string name="rmd_EPr_vibrate_title">Vibrate on Alert</string> <string name="rmd_EPr_vibrate_title">Vibrate on Alert</string>
<!-- Reminder Preference: Vibrate Description (true) --> <!-- Reminder Preference: Vibrate Description (true) -->

@ -21,6 +21,10 @@
<CheckBoxPreference <CheckBoxPreference
android:key="@string/p_rmd_persistent" android:key="@string/p_rmd_persistent"
android:title="@string/rmd_EPr_persistent_title"/> android:title="@string/rmd_EPr_persistent_title"/>
<CheckBoxPreference
android:key="@string/p_rmd_maxvolume"
android:title="@string/rmd_EPr_multiple_maxvolume_title"
android:defaultValue="false" />
<CheckBoxPreference <CheckBoxPreference
android:key="@string/p_rmd_vibrate" android:key="@string/p_rmd_vibrate"
android:title="@string/rmd_EPr_vibrate_title" android:title="@string/rmd_EPr_vibrate_title"

Loading…
Cancel
Save