Check bluetooth supported before registering pan

This commit is contained in:
Mygod
2020-07-07 05:02:36 +08:00
parent 1ef2718d8c
commit a1b076cee9

View File

@@ -95,7 +95,7 @@ class BluetoothTethering(context: Context, val stateListener: () -> Unit) :
private val receiver = broadcastReceiver { _, _ -> stateListener() }
init {
try {
if (BluetoothAdapter.getDefaultAdapter() != null) try {
pan = pan(context, this)
} catch (e: InvocationTargetException) {
Timber.w(e)