summaryrefslogtreecommitdiff
path: root/same-android/src/main/java/com/orbekk/same/SameService.java
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-25 22:39:07 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-02-25 22:39:07 +0100
commitcd22ae793f261976d29f2d02f852ef657be0c6bb (patch)
treee7e8adb022ab88a0eca7f9d6c556df522e10d78f /same-android/src/main/java/com/orbekk/same/SameService.java
parentdfbb6b1a8b7d33a2e2097187ddc07d379163bce7 (diff)
Send state updates from SameService.
Diffstat (limited to 'same-android/src/main/java/com/orbekk/same/SameService.java')
-rw-r--r--same-android/src/main/java/com/orbekk/same/SameService.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/same-android/src/main/java/com/orbekk/same/SameService.java b/same-android/src/main/java/com/orbekk/same/SameService.java
index 78bc62a..53742bd 100644
--- a/same-android/src/main/java/com/orbekk/same/SameService.java
+++ b/same-android/src/main/java/com/orbekk/same/SameService.java
@@ -15,6 +15,7 @@ import android.os.Messenger;
import android.os.RemoteException;
import android.widget.Toast;
+import com.orbekk.same.State.Component;
import com.orbekk.same.android.net.AndroidBroadcasterFactory;
import com.orbekk.same.android.net.Broadcaster;
import com.orbekk.same.config.Configuration;
@@ -107,6 +108,16 @@ public class SameService extends Service {
private final Messenger messenger = new Messenger(new InterfaceHandler());
+ private StateChangedListener stateListener = new StateChangedListener() {
+ @Override
+ public void stateChanged(Component component) {
+ for (Messenger messenger : stateReceivers) {
+ Message message = Message.obtain(null, UPDATED_STATE_MESSAGE);
+ message.obj = component;
+ }
+ }
+ };
+
private void initializeConfiguration() {
Properties properties = new Properties();
String localIp = new Broadcaster(this)