title: Bluetooth connection timeout: dm_pm_timer expires
body: <p>I'm facing a problem where the bluetooth connection times out on receiving messages.
  I'm not establishing the bluetooth connection myself, that is done by methods within the API I'm using</p>
  
  <p>the logcat says:</p>
  
  <pre><code>09-20 10:44:31.270: W/bt-btif(883): dm_pm_timer expires
  09-20 10:44:31.270: W/bt-btif(883): dm_pm_timer expires 0
  09-20 10:44:31.290: W/bt-btif(883): proc dm_pm_timer expires
  09-20 10:44:31.310: E/bt-btif(883): bta_dm_pm_btm_status  hci_status=36
  </code></pre>
  
  <p>I read in some other topics, but found no solution for my problem</p>
  
  <p>Here in addition some code of my receiving Thread:</p>
  
  <pre><code>class RxThread extends Thread {
  
      Handler myHandler = new Handler();
  
      final Runnable r = new Runnable() {
          public void run() {
  
              demoRxMsg = new MessageStructure();
              int progress = 0;
  
              generateLogFileOnSD(logData, logText);
  
              while (rxChannel.receiveMessage(demoRxMsg) == ReturnCode.SUCCESS) {
  
                  String data = "";
                  String format = "";
  
  
                  rxChannel.receiveMessage(demoRxMsg);
  
                  if (demoRxMsg.frameFormat == API_ADK.STANDARD_FRAME) {
                      format = "SFF";
                  } else {
                      format = "EFF";
                  }
  
                  for (byte i = 0; i &lt; demoRxMsg.dataLength; i++) {
                      data = data + Integer.toHexString(demoRxMsg.data[i])
                              + " ";
  
                  }
  
  
                  @SuppressWarnings("rawtypes")
                  Map keyMap = ResourceUtils.getHashMapResource(DiagnosisActivity.this, R.xml.hashmap1);
  
                  @SuppressWarnings("rawtypes")
                  Iterator iter = keyMap.entrySet().iterator();
  
                  while(iter.hasNext()) {
                      @SuppressWarnings("rawtypes")
                      Map.Entry mEntry = (Map.Entry) iter.next();
                      if (data.contains(mEntry.getKey().toString())) {
                          progress = Integer.parseInt(mEntry.getValue().toString());
                      }
                  }
  
          newLogText = format + "; ID=0x"
                              + Integer.toHexString(demoRxMsg.messageID)
                              + " Data=" + data + "\n";
  
                      logText = logText + newLogText;
  
                      writeLogFileOnSD(logData, logText);
                      }
              }
              if (progress != -1) {
                  final int newProgress = progress;
  
                  myHandler.post(new Runnable() {
                      public void run() {
                          mProgressBar.setProgress(newProgress);
                      }
                  });
              }
          }
      };
  
      public void run() {
          while (true) {
              try {
                  Thread.sleep(60);
                  myHandler.post(r);
              } catch (InterruptedException e) {
                  break;
              }
          }
      }
  </code></pre>