Commit 327f01f9 by Dani Palou Committed by Sebastián Katzer

Allow configuring Android led time (#1080)

Default time extended from 100 to 1000 ms
parent 366557fd
......@@ -131,7 +131,7 @@ public class Builder {
.setColor(options.getColor());
if (ledColor != 0) {
builder.setLights(ledColor, 100, 100);
builder.setLights(ledColor, options.getLedOnTime(), options.getLedOffTime());
}
if (sound != null) {
......
......@@ -252,6 +252,42 @@ public class Options {
/**
* @return
* The time that the LED should be on (in milliseconds).
*/
public int getLedOnTime() {
String timeOn = options.optString("ledOnTime", null);
if (timeOn == null) {
return 1000;
}
try {
return Integer.parseInt(timeOn);
} catch (NumberFormatException e) {
return 1000;
}
}
/**
* @return
* The time that the LED should be off (in milliseconds).
*/
public int getLedOffTime() {
String timeOff = options.optString("ledOffTime", null);
if (timeOff == null) {
return 1000;
}
try {
return Integer.parseInt(timeOff);
} catch (NumberFormatException e) {
return 1000;
}
}
/**
* @return
* The notification background color for the small icon
* Returns null, if no color is given.
*/
......
......@@ -68,6 +68,8 @@ exports.applyPlatformSpecificOptions = function () {
defaults.ongoing = false;
defaults.autoClear = true;
defaults.led = undefined;
defaults.ledOnTime = undefined;
defaults.ledOffTime = undefined;
defaults.color = undefined;
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment