Add the option to mute notifications for one year.

Fixes #4448.
Closes #4454
This commit is contained in:
Sebastian Morr 2015-11-08 19:22:23 +01:00 committed by Moxie Marlinspike
parent d05097a6fd
commit 181c7dfd85
3 changed files with 8 additions and 5 deletions

View File

@ -158,6 +158,7 @@
<item>@string/arrays__mute_for_two_hours</item>
<item>@string/arrays__mute_for_one_day</item>
<item>@string/arrays__mute_for_seven_days</item>
<item>@string/arrays__mute_for_one_year</item>
</string-array>
<string-array name="recipient_vibrate_entries">

View File

@ -840,6 +840,7 @@
<string name="arrays__mute_for_two_hours">Mute for 2 hours</string>
<string name="arrays__mute_for_one_day">Mute for 1 day</string>
<string name="arrays__mute_for_seven_days">Mute for 7 days</string>
<string name="arrays__mute_for_one_year">Mute for 1 year</string>
<string name="arrays__settings_default">Settings default</string>
<string name="arrays__enabled">Enabled</string>

View File

@ -21,11 +21,12 @@ public class MuteDialog extends AlertDialogWrapper {
final long muteUntil;
switch (which) {
case 0: muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1); break;
case 1: muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(2); break;
case 2: muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1); break;
case 3: muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(7); break;
default: muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1); break;
case 0: muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1); break;
case 1: muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(2); break;
case 2: muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(1); break;
case 3: muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(7); break;
case 4: muteUntil = System.currentTimeMillis() + TimeUnit.DAYS.toMillis(365); break;
default: muteUntil = System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1); break;
}
listener.onMuted(muteUntil);