temporarliy got rid of some insane work arounds in favor of some maybe less insane work arounds

This commit is contained in:
iNPUTmice 2014-11-11 00:16:43 +01:00
parent c8a6b05163
commit fce78abb1c
3 changed files with 17 additions and 14 deletions

View file

@ -401,10 +401,10 @@ public class XmppConnectionService extends Service {
} }
} }
} }
PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE); /*PowerManager pm = (PowerManager) this.getSystemService(Context.POWER_SERVICE);
if (!pm.isScreenOn()) { if (!pm.isScreenOn()) {
removeStaleListeners(); removeStaleListeners();
} }*/
if (wakeLock.isHeld()) { if (wakeLock.isHeld()) {
try { try {
wakeLock.release(); wakeLock.release();
@ -1080,11 +1080,11 @@ public class XmppConnectionService extends Service {
public void setOnConversationListChangedListener( public void setOnConversationListChangedListener(
OnConversationUpdate listener) { OnConversationUpdate listener) {
if (!isScreenOn()) { /*if (!isScreenOn()) {
Log.d(Config.LOGTAG, Log.d(Config.LOGTAG,
"ignoring setOnConversationListChangedListener"); "ignoring setOnConversationListChangedListener");
return; return;
} }*/
synchronized (this.convChangedListenerCount) { synchronized (this.convChangedListenerCount) {
if (checkListeners()) { if (checkListeners()) {
switchToForeground(); switchToForeground();
@ -1110,10 +1110,10 @@ public class XmppConnectionService extends Service {
} }
public void setOnAccountListChangedListener(OnAccountUpdate listener) { public void setOnAccountListChangedListener(OnAccountUpdate listener) {
if (!isScreenOn()) { /*if (!isScreenOn()) {
Log.d(Config.LOGTAG, "ignoring setOnAccountListChangedListener"); Log.d(Config.LOGTAG, "ignoring setOnAccountListChangedListener");
return; return;
} }*/
synchronized (this.accountChangedListenerCount) { synchronized (this.accountChangedListenerCount) {
if (checkListeners()) { if (checkListeners()) {
switchToForeground(); switchToForeground();
@ -1137,10 +1137,10 @@ public class XmppConnectionService extends Service {
} }
public void setOnRosterUpdateListener(OnRosterUpdate listener) { public void setOnRosterUpdateListener(OnRosterUpdate listener) {
if (!isScreenOn()) { /*if (!isScreenOn()) {
Log.d(Config.LOGTAG, "ignoring setOnRosterUpdateListener"); Log.d(Config.LOGTAG, "ignoring setOnRosterUpdateListener");
return; return;
} }*/
synchronized (this.rosterChangedListenerCount) { synchronized (this.rosterChangedListenerCount) {
if (checkListeners()) { if (checkListeners()) {
switchToForeground(); switchToForeground();

View file

@ -899,9 +899,8 @@ public class ConversationActivity extends XmppActivity implements
startActivity(new Intent(getApplicationContext(), startActivity(new Intent(getApplicationContext(),
StartConversationActivity.class)); StartConversationActivity.class));
finish(); finish();
} else {
ConversationActivity.this.mConversationFragment.updateMessages();
} }
ConversationActivity.this.mConversationFragment.updateMessages();
} }
}); });
} }

View file

@ -105,7 +105,11 @@ public abstract class XmppActivity extends Activity {
XmppConnectionBinder binder = (XmppConnectionBinder) service; XmppConnectionBinder binder = (XmppConnectionBinder) service;
xmppConnectionService = binder.getService(); xmppConnectionService = binder.getService();
xmppConnectionServiceBound = true; xmppConnectionServiceBound = true;
if (!isFinishing() && !isDestroyed()) {
onBackendConnected(); onBackendConnected();
} else {
Log.d(Config.LOGTAG,"omitting call to onBackendConnected()");
}
} }
@Override @Override