Skip to content

Commit

Permalink
Disable ping manager on connection closed
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Ricci <[email protected]>
  • Loading branch information
daniele-athome committed Mar 4, 2015
1 parent e4e63fb commit 526db72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,10 @@ public void shutdown() throws NotConnectedException {


public interface ConnectionHelperListener extends ConnectionListener {
/** Connection has been created. */
public void created(XMPPConnection connection);

/** Connection was aborted and will never be tried again. */
public void aborted(Exception e);

public void authenticationFailed();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ private synchronized void quit(boolean restarting) {

// disconnect from server (if any)
if (mConnection != null) {
// disable ping manager
ServerPingWithAlarmManager.getInstanceFor(mConnection).setEnabled(false);
// this is because of NetworkOnMainThreadException
new DisconnectThread(mConnection).start();
mConnection = null;
Expand Down

0 comments on commit 526db72

Please sign in to comment.