src/com/beem/project/beem/utils/BeemBroadcastReceiver.java
changeset 584 72d9d76900af
parent 577 29ac85113420
child 586 98d62b28ad77
--- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java	Thu Dec 17 16:15:02 2009 +0100
+++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java	Fri Dec 18 20:32:43 2009 +0100
@@ -60,16 +60,12 @@
 
     /** Broadcast intent type. */
     public static final String BEEM_CONNECTION_CLOSED = "BeemConnectionClosed";
-    private ServiceConnection mService;
-    private boolean mIsBinded;
 
     /**
      * constructor.
      * @param service service observed
      */
-    public BeemBroadcastReceiver(final ServiceConnection service) {
-	mService = service;
-	mIsBinded = false;
+    public BeemBroadcastReceiver() {
     }
 
     /**
@@ -78,9 +74,6 @@
     @Override
     public void onReceive(Context context, Intent intent) {
 	Log.d("Broadcast", "onReceive");
-	if (mIsBinded)
-	    context.unbindService(mService);
-	setBinded(false);
 	// TODO ce code est comment car il empeche de gerer un cancel sur une connexion
 	// start activity if unexpected disconnection
 	// if (!intent.getBooleanExtra("normally", false))
@@ -90,22 +83,7 @@
 	if (context instanceof Activity) {
 	    Activity act = (Activity) context;
 	    act.finish();
+	    // The service will be unbinded in the destroy of the activity.
 	}
     }
-
-    /**
-     * service is binded.
-     * @param binded the state of the bind.
-     */
-    public void setBinded(boolean binded) {
-	mIsBinded = binded;
-    }
-
-    /**
-     * return service bind status.
-     * @return service bind status.
-     */
-    public boolean isBinded() {
-	return mIsBinded;
-    }
 }