Check bluetooth supported before registering pan
This commit is contained in:
@@ -95,7 +95,7 @@ class BluetoothTethering(context: Context, val stateListener: () -> Unit) :
|
|||||||
private val receiver = broadcastReceiver { _, _ -> stateListener() }
|
private val receiver = broadcastReceiver { _, _ -> stateListener() }
|
||||||
|
|
||||||
init {
|
init {
|
||||||
try {
|
if (BluetoothAdapter.getDefaultAdapter() != null) try {
|
||||||
pan = pan(context, this)
|
pan = pan(context, this)
|
||||||
} catch (e: InvocationTargetException) {
|
} catch (e: InvocationTargetException) {
|
||||||
Timber.w(e)
|
Timber.w(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user