title: BluetoothLeScanner.startScan with Android 6.0 does not discover devices
body: <p>I'm trying to use the function <em>BluatoothLeScanner.startScan</em> instead of the deprecated one <em>BluetoothAdapter.startLeScan</em>.
  Yesterday I updated my Nexus 5 to Android 6.0 and since that moment my app does not work anymore.
  I firstly add the preferences required <em>ACCESS_COARSE_LOCATION</em> as found here,  <a href="https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id" rel="noreferrer">https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id</a>.
  Then I added the permission as described here: <a href="https://developer.android.com/training/permissions/requesting.html" rel="noreferrer">https://developer.android.com/training/permissions/requesting.html</a>.
  But at the end it seems not working, it does not send back the ble devices.</p>
  
  <p>This is my code:</p>
  
  <p><strong>manifest</strong></p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
            package="com.stm.sensitronapp"&gt;
            &lt;uses-sdk android:maxSdkVersion="23"/&gt;
            &lt;uses-feature android:name="android.hardware.bluetooth_le" android:required="true"/&gt;
  
            &lt;uses-permission android:name="android.permission.BLUETOOTH"/&gt;
            &lt;uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/&gt;
            &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;`
  </code></pre>
  
  <p><strong>DeviceScanActivity</strong></p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  ...
  
  if (ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_COARSE_LOCATION)
              != PackageManager.PERMISSION_GRANTED){
          if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                  Manifest.permission.ACCESS_COARSE_LOCATION)) {
          } else {
              ActivityCompat.requestPermissions(this,
                      new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
                      MY_PERMISSIONS_REQUEST_ACCESS_COARSE);
          }
      }
  
  // Device scan callback.
      if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) {
          if (ContextCompat.checkSelfPermission(this,Manifest.permission.ACCESS_COARSE_LOCATION)
                  == PackageManager.PERMISSION_GRANTED) {
              mScanCallback = new ScanCallback() {
                  @Override
                  public void onScanResult(int callbackType, ScanResult result) {
                      super.onScanResult(callbackType, result);
                      mLeDeviceListAdapter.addDevice(result.getDevice());
                      mLeDeviceListAdapter.notifyDataSetChanged();
                  }
              };
          }
      } 
  }
  final BluetoothManager bluetoothManager =
              (BluetoothManager) getSystemService(Context.BLUETOOTH_SERVICE);
  mBluetoothAdapter = bluetoothManager.getAdapter();
  
  if (mBluetoothAdapter.getState() == BluetoothAdapter.STATE_ON) {
          mSwipeRefreshLayout.setRefreshing(true);
          mLeDeviceListAdapter.clear();
          mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();
          if(ContextCompat.checkSelfPermission(this,
                      Manifest.permission.ACCESS_COARSE_LOCATION ) == PackageManager.PERMISSION_GRANTED) {
                  mBluetoothLeScanner.startScan(mScanCallback);
              }
          }
  </code></pre>
  
  <p>EDIT: to solve this problem I only turned on the GPS. It is easy to do it programmatically in <a href="https://developers.google.com/android/reference/com/google/android/gms/location/SettingsApi" rel="noreferrer">this way</a>.</p>