title: Android 4.4.4 Moto G Bluetooth LE reconnect issue
body: <p>I have an app that works great on a Samsung S3 running Android 4.3 however i've having issues on a Moto G running 4.4.4</p>
  
  <p>My BLE peripheral connects and disconnects several times during the apps use. This works fine however sometimes there comes a point where the app/phone no longer reconnects to the peripheral.</p>
  
  <p>All gatt commands are run on the main thread, eg.</p>
  
  <pre><code>final BluetoothGatt gat = gatt;
  Handler handler = new Handler(Looper.getMainLooper());
  handler.post(new Runnable() {
  @Override
  public void run() {
    // This code will be executed on the main thread
    if (Looper.myLooper() == Looper.getMainLooper()) {
      Log.e(TAG, "mGattCallback disconnect2: NOW ON MAIN THREAD :)");
    }
    gat.disconnect();
    }
  });
  </code></pre>
  
  <p>and the peripheral disconnects fine. When this happens and I can't reconnect to the peripheral any more, I get loads of log's like this:</p>
  
  <pre><code>04-07 16:57:56.798: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:56.798: I/bt-hci(2127): btu_ble_process_adv_pkt
  04-07 16:57:56.833: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:56.833: I/bt-hci(2127): btu_ble_process_adv_pkt
  04-07 16:57:56.871: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:56.871: I/bt-hci(2127): btu_ble_process_adv_pkt
  04-07 16:57:56.906: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:56.906: I/bt-hci(2127): btu_ble_process_adv_pkt
  04-07 16:57:56.941: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:56.941: I/bt-hci(2127): btu_ble_process_adv_pkt
  04-07 16:57:56.977: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:56.977: I/bt-hci(2127): btu_ble_process_adv_pkt
  04-07 16:57:57.016: I/bt-hci(2127): BLE HCI(id=62) event = 0x02)
  04-07 16:57:57.016: I/bt-hci(2127): btu_ble_process_adv_pkt
  </code></pre>
  
  <p>and I need to quit the app, turn bluetooth off and on again for it to start working properly again.</p>
  
  <p>Any known issues, tips or advice?</p>
  
  <p>Thanks</p>
  
  <p>EDIT -----------
  After some more testing, it seems that leaving the app running, eventually I get the following logs and then my peripheral can reconnect again:</p>
  
  <pre><code>04-13 19:11:53.973: I/bt-hci(2034): BLE HCI(id=62) event = 0x02)
  04-13 19:11:53.973: I/bt-hci(2034): btu_ble_process_adv_pkt
  04-13 19:11:54.076: I/bt-hci(2034): BLE HCI(id=62) event = 0x02)
  04-13 19:11:54.076: I/bt-hci(2034): btu_ble_process_adv_pkt
  04-13 19:11:55.986: I/bt-hci(2034): BLE HCI(id=62) event = 0x02)
  04-13 19:11:55.986: I/bt-hci(2034): btu_ble_process_adv_pkt
  04-13 19:11:56.087: I/bt-hci(2034): BLE HCI(id=62) event = 0x02)
  04-13 19:11:56.087: I/bt-hci(2034): btu_ble_process_adv_pkt
  04-13 19:11:56.629: I/bt-hci(2034): BLE HCI(id=62) event = 0x02)
  04-13 19:11:56.629: I/bt-hci(2034): btu_ble_process_adv_pkt
  04-13 19:11:56.734: I/bt-hci(2034): BLE HCI(id=62) event = 0x02)
  04-13 19:11:56.734: I/bt-hci(2034): btu_ble_process_adv_pkt
  04-13 19:11:58.925: D/MDMCTBK(275): reply_len: 40 reply is = IFNAME=wlan0 &lt;3&gt;CTRL-EVENT-SCAN-RESULTS 
  04-13 19:11:58.925: D/MDMCTBK(275): Event received = CTRL-EVENT-SCAN-RESULTS 
  04-13 19:11:58.926: D/WifiStateMachine(1010): handleMessage: E msg.what=147461
  04-13 19:11:58.926: D/WifiStateMachine(1010): processMsg: DisconnectedState
  04-13 19:11:58.926: D/WifiStateMachine(1010): processMsg: ConnectModeState
  04-13 19:11:58.926: D/WifiStateMachine(1010): processMsg: DriverStartedState
  04-13 19:11:58.927: D/WifiStateMachine(1010): processMsg: SupplicantStartedState
  04-13 19:11:58.928: D/TCMD(4253): NL - Read 56 bytes from update socket.
  04-13 19:11:58.928: D/TCMD(4253): NL - message type is RTM_NEWLINK
  04-13 19:11:58.928: D/TCMD(4253): Listening for incoming client connection request
  04-13 19:35:18.787: V/AlarmManager(1010): sending alarm Alarm{42b84cc0 type 2 com.google.android.gms}
  04-13 19:35:18.787: V/AlarmManager(1010): sending alarm Alarm{42b83a00 type 0 android}
  04-13 19:11:58.941: D/WifiStateMachine(1010): handleMessage: X
  04-13 19:12:00.615: D/WifiStateMachine(1010): handleMessage: E msg.what=131143
  04-13 19:12:00.615: D/WifiStateMachine(1010): processMsg: DisconnectedState
  04-13 19:12:00.616: D/WifiStateMachine(1010): processMsg: ConnectModeState
  04-13 19:12:00.617: D/WifiStateMachine(1010): processMsg: DriverStartedState
  04-13 19:12:00.628: D/WifiStateMachine(1010): handleMessage: X
  04-13 19:12:01.425: D/MDMCTBK(275): reply_len: 40 reply is = IFNAME=wlan0 &lt;3&gt;CTRL-EVENT-BSS-REMOVED 1
  04-13 19:12:01.425: D/MDMCTBK(275): Event received = CTRL-EVENT-BSS-REMOVED 1
  04-13 19:12:01.425: D/MDMCTBK(275): reply_len: 40 reply is = IFNAME=wlan0 &lt;3&gt;CTRL-EVENT-SCAN-RESULTS 
  04-13 19:12:01.425: D/MDMCTBK(275): Event received = CTRL-EVENT-SCAN-RESULTS 
  04-13 19:12:01.425: D/WifiStateMachine(1010): handleMessage: E msg.what=147461
  04-13 19:12:01.426: D/WifiStateMachine(1010): processMsg: DisconnectedState
  04-13 19:12:01.426: D/WifiStateMachine(1010): processMsg: ConnectModeState
  04-13 19:12:01.426: D/WifiStateMachine(1010): processMsg: DriverStartedState
  04-13 19:12:01.426: D/WifiStateMachine(1010): processMsg: SupplicantStartedState
  04-13 19:12:01.428: D/MDMCTBK(275): reply_len: 40 reply is = IFNAME=p2p0 &lt;3&gt;CTRL-EVENT-BSS-REMOVED 1 
  04-13 19:12:01.428: D/MDMCTBK(275): Event received = CTRL-EVENT-BSS-REMOVED 1 
  04-13 19:12:01.428: D/TCMD(4253): NL - Read 56 bytes from update socket.
  04-13 19:12:01.428: D/TCMD(4253): NL - message type is RTM_NEWLINK
  04-13 19:12:01.428: D/TCMD(4253): Listening for incoming client connection request
  04-13 19:12:01.444: D/WifiStateMachine(1010): handleMessage: X
  </code></pre>
  
  <p>It's looking like it's something to do with the WiFi?!</p>