aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Lukas <georg@op-co.de>2010-03-24 03:56:02 +0000
committerKenny Root <kenny@the-b.org>2010-03-24 03:56:02 +0000
commitb4146d8391e3dd4d9e323df286028ca2d8ae0f01 (patch)
tree6542df24421ab5d57fd6ca2e7e7d2ebdbd6511ea
parent7d85d2291c51df87e1d7176690cdca9239873a3b (diff)
downloadconnectbot-b4146d8391e3dd4d9e323df286028ca2d8ae0f01.tar.gz
connectbot-b4146d8391e3dd4d9e323df286028ca2d8ae0f01.tar.bz2
connectbot-b4146d8391e3dd4d9e323df286028ca2d8ae0f01.zip
notification with LED lights
From: Georg Lukas <georg@op-co.de> git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@494 df292f66-193f-0410-a5fc-6d59da041ff2
-rw-r--r--src/org/connectbot/service/ConnectionNotifier.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/connectbot/service/ConnectionNotifier.java b/src/org/connectbot/service/ConnectionNotifier.java
index 31be52c..014f833 100644
--- a/src/org/connectbot/service/ConnectionNotifier.java
+++ b/src/org/connectbot/service/ConnectionNotifier.java
@@ -20,6 +20,7 @@ package org.connectbot.service;
import org.connectbot.ConsoleActivity;
import org.connectbot.R;
import org.connectbot.bean.HostBean;
+import org.connectbot.util.HostDatabase;
import org.connectbot.util.PreferenceConstants;
import android.app.Notification;
@@ -29,6 +30,7 @@ import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
+import android.graphics.Color;
/**
* @author Kenny Root
@@ -77,6 +79,19 @@ public abstract class ConnectionNotifier {
notification.flags = Notification.FLAG_AUTO_CANCEL;
+ notification.flags |= Notification.DEFAULT_LIGHTS;
+ if (HostDatabase.COLOR_RED.equals(host.getColor()))
+ notification.ledARGB = Color.RED;
+ else if (HostDatabase.COLOR_GREEN.equals(host.getColor()))
+ notification.ledARGB = Color.GREEN;
+ else if (HostDatabase.COLOR_BLUE.equals(host.getColor()))
+ notification.ledARGB = Color.BLUE;
+ else
+ notification.ledARGB = Color.WHITE;
+ notification.ledOnMS = 300;
+ notification.ledOffMS = 1000;
+ notification.flags |= Notification.FLAG_SHOW_LIGHTS;
+
return notification;
}