コード例 #1
0
  private void resetConnection() {
    Log.d(MetaWatch.TAG, "MetaWatchService.resetConnection()");

    wakeLock.acquire(5000);

    try {
      if (connectionState != ConnectionState.DISCONNECTING) {
        connectionState = ConnectionState.CONNECTING;
        disconnect();
      }
    } finally {
      if (wakeLock != null && wakeLock.isHeld()) {
        wakeLock.release();
      }
    }
  }
コード例 #2
0
 void disconnectExit() {
   connectionState = ConnectionState.DISCONNECTING;
   updateNotification();
   disconnect();
 }