Permalink
Browse files

Re-initialise connection on ArrayIndexOutOfBoundsException

  • Loading branch information...
1 parent 610a70e commit 325b7c24d5dd9d6bb485beabc59e5effc6e426cc @benjymous committed Apr 21, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/org/metawatch/manager/MetaWatchService.java
@@ -858,6 +858,12 @@ else if (bytes[2] == eMessageType.GeneralPurposePhoneMsg.msg) {
connectionState = ConnectionState.CONNECTING;
broadcastConnection(false);
}
+ } catch(ArrayIndexOutOfBoundsException e) {
+ wakeLock.acquire(5000);
+ if (connectionState != ConnectionState.DISCONNECTING) {
+ connectionState = ConnectionState.CONNECTING;
+ broadcastConnection(false);
+ }
}
}

0 comments on commit 325b7c2

Please sign in to comment.