Use invoke operators
This commit is contained in:
@@ -92,7 +92,7 @@ class BluetoothTethering(context: Context, val stateListener: (Int) -> Unit) :
|
||||
activeFailureCause = null
|
||||
val pan = pan ?: return null
|
||||
return BluetoothAdapter.getDefaultAdapter()?.state == BluetoothAdapter.STATE_ON && try {
|
||||
isTetheringOn.invoke(pan) as Boolean
|
||||
isTetheringOn(pan) as Boolean
|
||||
} catch (e: InvocationTargetException) {
|
||||
activeFailureCause = e.cause ?: e
|
||||
if (e.cause is SecurityException && BuildCompat.isAtLeastR()) Timber.d(e) else Timber.w(e)
|
||||
|
||||
Reference in New Issue
Block a user