Skip to content

Commit

Permalink
Add some more logging around resuming and reconnecting
Browse files Browse the repository at this point in the history
  • Loading branch information
c99koder committed Nov 23, 2016
1 parent cb3dcf0 commit 76c1d06
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/com/irccloud/android/NetworkConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public void onReceive(Context context, Intent intent) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo ni = cm.getActiveNetworkInfo();

Crashlytics.log(Log.INFO, TAG, "Connectivity changed, connected: " + ((ni != null)?ni.isConnected():"Unknown"));
Crashlytics.log(Log.INFO, TAG, "Connectivity changed, connected: " + ((ni != null)?ni.isConnected():"Unknown") + ", connected or connecting: " + ((ni != null)?ni.isConnectedOrConnecting():"Unknown"));

if (ni != null && ni.isConnected() && (state == STATE_DISCONNECTED || state == STATE_DISCONNECTING) && session != null && handlers.size() > 0) {
Crashlytics.log(Log.INFO, TAG, "Network became available, reconnecting");
Expand Down
1 change: 1 addition & 0 deletions src/com/irccloud/android/activity/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public void onResume() {
protected void onPostResume() {
super.onPostResume();
if(conn != null){
Crashlytics.log(Log.INFO, "IRCCloud", "App resumed, websocket state: " + conn.getState());
if(conn.getState() == NetworkConnection.STATE_DISCONNECTED || conn.getState() == NetworkConnection.STATE_DISCONNECTING)
conn.connect();
}
Expand Down

0 comments on commit 76c1d06

Please sign in to comment.