Give user the opportunity to chose no LED-notification.

This commit is contained in:
3xo 2014-03-04 11:05:56 +01:00 committed by Moxie Marlinspike
parent 574f33c92d
commit 339193af12
3 changed files with 10 additions and 3 deletions

View File

@ -82,6 +82,7 @@
<item>@string/preferences__cyan</item>
<item>@string/preferences__magenta</item>
<item>@string/preferences__white</item>
<item>@string/preferences__none</item>
</string-array>
@ -93,6 +94,7 @@
<item>cyan</item>
<item>magenta</item>
<item>white</item>
<item>none</item>
</string-array>
<string-array name="pref_led_blink_pattern_entries">

View File

@ -693,6 +693,7 @@
<string name="preferences__cyan">Cyan</string>
<string name="preferences__magenta">Magenta</string>
<string name="preferences__white">White</string>
<string name="preferences__none">None</string>
<string name="preferences__fast">Fast</string>
<string name="preferences__normal">Normal</string>
<string name="preferences__slow">Slow</string>

View File

@ -361,11 +361,15 @@ public class MessageNotifier {
builder.setSound(TextUtils.isEmpty(ringtone) || !signal ? null : Uri.parse(ringtone));
if (signal && vibrate)
if (signal && vibrate) {
builder.setDefaults(Notification.DEFAULT_VIBRATE);
}
builder.setLights(Color.parseColor(ledColor), Integer.parseInt(blinkPatternArray[0]),
Integer.parseInt(blinkPatternArray[1]));
if (!ledColor.equals("none")) {
builder.setLights(Color.parseColor(ledColor),
Integer.parseInt(blinkPatternArray[0]),
Integer.parseInt(blinkPatternArray[1]));
}
}
private static String[] parseBlinkPattern(String blinkPattern, String blinkPatternCustom) {