private void rosterChanged() { // gracefully handle^W ignore events after a disconnect if (mSmackable == null) return; if (!mIsConnected.get() && mSmackable.isAuthenticated()) { // We get a roster changed update, but we are not connected, // that means we just got connected and need to notify the Activity. logInfo("rosterChanged(): we just got connected"); // connectionEstablished(); } if (mIsConnected.get() && mSmackable != null && !mSmackable.isAuthenticated()) { logInfo("rosterChanged(): disconnected without warning"); connectionFailed(getString(R.string.conn_disconnected)); } }