From 659c1a34e0cc2ecd04511af5b7a49b3e08dae89b Mon Sep 17 00:00:00 2001 From: Mygod Date: Wed, 24 Jun 2020 06:56:17 +0800 Subject: [PATCH] Make BluetoothPan accessible --- .../java/be/mygod/vpnhotspot/manage/BluetoothTethering.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/manage/BluetoothTethering.kt b/mobile/src/main/java/be/mygod/vpnhotspot/manage/BluetoothTethering.kt index 75d6aab5..d8b21250 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/manage/BluetoothTethering.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/manage/BluetoothTethering.kt @@ -24,7 +24,9 @@ class BluetoothTethering(context: Context, val stateListener: () -> Unit) : private const val PAN = 5 private val clazz by lazy { Class.forName("android.bluetooth.BluetoothPan") } private val constructor by lazy { - clazz.getDeclaredConstructor(Context::class.java, BluetoothProfile.ServiceListener::class.java) + clazz.getDeclaredConstructor(Context::class.java, BluetoothProfile.ServiceListener::class.java).apply { + isAccessible = true + } } private val isTetheringOn by lazy { clazz.getDeclaredMethod("isTetheringOn") }