Use invoke operators

This commit is contained in:
Mygod
2020-05-30 21:01:22 -04:00
parent 6e5714913c
commit 9e820e888f
5 changed files with 24 additions and 25 deletions

View File

@@ -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)