diff --git a/sbapp/main.py b/sbapp/main.py
index 4a45b2f..72cbf0c 100644
--- a/sbapp/main.py
+++ b/sbapp/main.py
@@ -377,7 +377,12 @@ class SidebandApp(MDApp):
mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
Context = autoclass('android.content.Context')
- if check_permission("android.permission.BLUETOOTH_CONNECT"):
+ if android_api_version > 30:
+ bt_permission_name = "android.permission.BLUETOOTH_CONNECT"
+ else:
+ bt_permission_name = "android.permission.BLUETOOTH"
+
+ if check_permission(bt_permission_name):
RNS.log("Have bluetooth connect permissions", RNS.LOG_DEBUG)
self.sideband.setpersistent("permissions.bluetooth", True)
else:
diff --git a/sbapp/patches/AndroidManifest.tmpl.xml b/sbapp/patches/AndroidManifest.tmpl.xml
index cf24d44..f886763 100644
--- a/sbapp/patches/AndroidManifest.tmpl.xml
+++ b/sbapp/patches/AndroidManifest.tmpl.xml
@@ -27,6 +27,9 @@
+
+
+
{% for perm in args.permissions %}
{% if '.' in perm %}
diff --git a/sbapp/services/sidebandservice.py b/sbapp/services/sidebandservice.py
index 478d3a9..8c8f1cf 100644
--- a/sbapp/services/sidebandservice.py
+++ b/sbapp/services/sidebandservice.py
@@ -1,4 +1,4 @@
-__debug_build__ = False
+__debug_build__ = True
import time
import RNS
diff --git a/sbapp/sideband/core.py b/sbapp/sideband/core.py
index 060adac..adf72ae 100644
--- a/sbapp/sideband/core.py
+++ b/sbapp/sideband/core.py
@@ -1551,6 +1551,8 @@ class SidebandCore():
else:
target_port = None
+ bt_device_name = None
+ rnode_allow_bluetooth = False
if self.getpersistent("permissions.bluetooth"):
if self.config["hw_rnode_bluetooth"]:
# TODO: Remove
@@ -1558,8 +1560,7 @@ class SidebandCore():
rnode_allow_bluetooth = True
if self.config["hw_rnode_bt_device"] != None:
bt_device_name = self.config["hw_rnode_bt_device"]
- else:
- bt_device_name = None
+
else:
# TODO: Remove
RNS.log("Disallowing RNode bluetooth since config is disabled")
@@ -1567,7 +1568,7 @@ class SidebandCore():
else:
# TODO: Remove
RNS.log("Disallowing RNode bluetooth due to missing permission")
- rnode_allow_bluetooth = True
+ rnode_allow_bluetooth = False