title: Bluetooth Battery Level API getBatteryLevel() is not working in Android 8.1.0
body: <p>I am trying to get the Battery Level from <code>BluetoothDevice</code> in Android 8.1.0 of remotely connected BT device.</p>
  
  <pre><code>BluetoothDevice mBTDevice = (BluetoothDevice) bundle
                          .getParcelable(BluetoothDevice.EXTRA_DEVICE);
  int val = mBtDevice.getBatteryLevel();
  </code></pre>
  
  <p>But its <code>val</code> always returning  value as "-1" . It seems not working in Android 8.1.0</p>
  
  <p>Got the info from this <a href="https://www.xda-developers.com/bluetooth-battery-level-indicators-android/" rel="nofollow noreferrer">link</a>  </p>