Misc refinements

This commit is contained in:
Mygod
2020-05-31 07:42:23 +08:00
parent d17cd0bab3
commit a3027812f0
2 changed files with 13 additions and 4 deletions

View File

@@ -94,7 +94,7 @@ class BluetoothTethering(context: Context, val stateListener: (Int) -> Unit) :
return BluetoothAdapter.getDefaultAdapter()?.state == BluetoothAdapter.STATE_ON && try {
isTetheringOn.invoke(pan) as Boolean
} catch (e: InvocationTargetException) {
activeFailureCause = e
activeFailureCause = e.cause ?: e
if (e.cause is SecurityException && BuildCompat.isAtLeastR()) Timber.d(e) else Timber.w(e)
return null
}