OnConnect demand bug correction
authorVincent V. <marseille@beem-project.com>
Thu, 29 Dec 2011 19:20:05 +0100
changeset 923 60061b3719fb
parent 922 85e37142da30
child 924 5aece2c91bef
OnConnect demand bug correction
src/com/beem/project/beem/BeemService.java
src/com/beem/project/beem/ui/Login.java
--- a/src/com/beem/project/beem/BeemService.java	Wed Dec 28 23:49:53 2011 +0100
+++ b/src/com/beem/project/beem/BeemService.java	Thu Dec 29 19:20:05 2011 +0100
@@ -422,7 +422,8 @@
 		accountName = b.getString(BeemIntent.EXTRA_ACCOUNT);
 		connection = mConnection.get(accountName);
 	    }
-	    if (connection == null && msg.what != MESSAGE_CONNECT && msg.what != MESSAGE_SYNC) {
+	    if (connection == null && msg.what != MESSAGE_CONNECT && msg.what != MESSAGE_SYNC
+		&& msg.what != MESSAGE_IS_CONNECTED) {
 		Toast.makeText(BeemService.this, getString(R.string.BeemServiceNotConnected, accountName),
 		    Toast.LENGTH_LONG).show();
 		return;
@@ -436,7 +437,7 @@
 		    break;
 		case MESSAGE_IS_CONNECTED:
 		    Intent res = new Intent(BeemIntent.ACTION_DISCONNECTED);
-		    res.putExtra(BeemIntent.EXTRA_MESSAGE, R.string.contact_status_msg_offline);
+		    //res.putExtra(BeemIntent.EXTRA_MESSAGE, R.string.contact_status_msg_offline);
 		    res.putExtra(BeemIntent.EXTRA_ACCOUNT, accountName);
 		    if (mConnection.containsKey(accountName))
 			res.setAction(BeemIntent.ACTION_CONNECTED);
--- a/src/com/beem/project/beem/ui/Login.java	Wed Dec 28 23:49:53 2011 +0100
+++ b/src/com/beem/project/beem/ui/Login.java	Thu Dec 29 19:20:05 2011 +0100
@@ -341,6 +341,7 @@
 	public void onReceive(Context context, Intent intent) {
 	    String action = intent.getAction();
 	    String account = intent.getExtras().getString(BeemIntent.EXTRA_ACCOUNT);
+	    Log.e("DEBUG", "ACTION " + action + " ACCOUNT " + account);
 	    int hash = account.hashCode();
 	    if (hash < 0)
 		hash = hash * -1;
@@ -358,6 +359,7 @@
 		}
 	    } else if (BeemIntent.ACTION_DISCONNECTED.equals(action)) {
 		String message = intent.getExtras().getString(BeemIntent.EXTRA_MESSAGE);
+		Log.e("DEBUG", "OO " + message);
 		if (text != null)
 		    text.setText(message);
 		if (logo != null) {