public void disconnectAll() { logger.info("Disconnecting all ..."); if (xmppConn.isConnected()) { logger.info("Detaching all the listeners for the connection."); PingManager.getInstanceFor(xmppConn).unregisterPingFailedListener(this); ReconnectionManager.getInstanceFor(xmppConn).removeReconnectionListener(this); xmppConn.removeAsyncStanzaListener(this); xmppConn.removeConnectionListener(this); xmppConn.removeStanzaInterceptor(this); xmppConn.removeAllRequestAckPredicates(); xmppConn.removeAllStanzaAcknowledgedListeners(); xmppConn.removeAllStanzaIdAcknowledgedListeners(); xmppConn.removeStanzaSendingListener(this); xmppConn.removeStanzaAcknowledgedListener(this); xmppConn.removeAllRequestAckPredicates(); logger.info("Disconnecting the xmpp server from FCM."); xmppConn.disconnect(); } }
= ReconnectionManager.getInstanceFor(connection); if (reconnectionManager != null) reconnectionManager.removeReconnectionListener(reConnListener);