Fix pan initialization failure crash
This commit is contained in:
@@ -103,7 +103,7 @@ class BluetoothTethering(context: Context, val stateListener: () -> Unit) :
|
|||||||
fun ensureInit(context: Context) {
|
fun ensureInit(context: Context) {
|
||||||
if (pan == null && BluetoothAdapter.getDefaultAdapter() != null) try {
|
if (pan == null && BluetoothAdapter.getDefaultAdapter() != null) try {
|
||||||
pan = pan(context, this)
|
pan = pan(context, this)
|
||||||
} catch (e: InvocationTargetException) {
|
} catch (e: ReflectiveOperationException) {
|
||||||
if (e.cause is SecurityException && BuildCompat.isAtLeastS()) Timber.d(e.readableMessage)
|
if (e.cause is SecurityException && BuildCompat.isAtLeastS()) Timber.d(e.readableMessage)
|
||||||
else Timber.w(e)
|
else Timber.w(e)
|
||||||
activeFailureCause = e
|
activeFailureCause = e
|
||||||
|
|||||||
Reference in New Issue
Block a user