From fbb05fa0d3b9a903c1e724edc703e610c437439d Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Mon, 16 Jan 2023 10:17:52 -0300 Subject: [PATCH] Regression: Add bluetooth permissions for Jitsi (#4796) * add blt permissions * Update AndroidManifest.xml * add blt permissions * remove wrong permission --- android/app/src/main/AndroidManifest.xml | 9 +++++++++ app/lib/methods/videoConf.ts | 18 ++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 0765164fb..1b48b17ba 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,15 @@ + + + + + + + + + => { + const systemVersion = await DeviceInfo.getApiLevel(); + if (systemVersion <= 28) { + return [PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT, PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN]; + } + if (systemVersion === 29) { + return [PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION]; + } + return [PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION]; +}; + export const videoConfJoin = async (callId: string, cam: boolean) => { try { const result = await Services.videoConferenceJoin(callId, cam); if (result.success) { if (isAndroid) { + const bltPermission = await handleBltPermission(); await PermissionsAndroid.requestMultiple([ PermissionsAndroid.PERMISSIONS.CAMERA, - PermissionsAndroid.PERMISSIONS.RECORD_AUDIO + PermissionsAndroid.PERMISSIONS.RECORD_AUDIO, + ...bltPermission ]); } const { url, providerName } = result;