ponewheel / android-ponewheel

pOneWheel Android app
MIT License
72 stars 25 forks source link

Check if device supports Bluetooth #74

Closed audkar closed 6 years ago

audkar commented 6 years ago

Even if AndroidManifest contains uses-feature requirement for Bluetooth it is still possible to manually install apk to device without Bluetooth. In my case I install app to Android emulator which doesn't have Bt.

Code without this fix causes infinitive loop:

  1. MainActivity.onResume calls reconnect() if Bl is not connected
  2. BluetoothUtilImpl.reconnect() try to start Bl enabling intent.
  3. Intent fails and MainActivity.onResume is called. Loop begins again
audkar commented 6 years ago

Not relevant anymore