diff --git a/platform/android/AndroidManifest.xml.in b/platform/android/AndroidManifest.xml.in index 1030d9c986..437e2ee1a9 100644 --- a/platform/android/AndroidManifest.xml.in +++ b/platform/android/AndroidManifest.xml.in @@ -11,8 +11,14 @@ - - + + + + = Build.VERSION_CODES.S) { + if (ContextCompat.checkSelfPermission( + QFieldActivity.this, Manifest.permission.BLUETOOTH_SCAN) == + PackageManager.PERMISSION_DENIED) { + permissionsList.add(Manifest.permission.BLUETOOTH_SCAN); + } + if (ContextCompat.checkSelfPermission( + QFieldActivity.this, + Manifest.permission.BLUETOOTH_CONNECT) == + PackageManager.PERMISSION_DENIED) { + permissionsList.add(Manifest.permission.BLUETOOTH_CONNECT); + } + } else { + if (ContextCompat.checkSelfPermission( + QFieldActivity.this, Manifest.permission.BLUETOOTH) == + PackageManager.PERMISSION_DENIED) { + permissionsList.add(Manifest.permission.BLUETOOTH); + } + if (ContextCompat.checkSelfPermission( + QFieldActivity.this, Manifest.permission.BLUETOOTH_ADMIN) == + PackageManager.PERMISSION_DENIED) { + permissionsList.add(Manifest.permission.BLUETOOTH_ADMIN); + } } if (permissionsList.size() > 0) { String[] permissions = new String[permissionsList.size()];