# HG changeset patch # User Vincent V. # Date 1325182805 -3600 # Node ID 60061b3719fba602975f9979a459f8a18f66459f # Parent 85e37142da30b506fbc1e4567d6935a120d0db74 OnConnect demand bug correction diff -r 85e37142da30 -r 60061b3719fb src/com/beem/project/beem/BeemService.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); diff -r 85e37142da30 -r 60061b3719fb src/com/beem/project/beem/ui/Login.java --- 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) {