From 5159547d6b6c3a624f501b0f07978b1a4c3b8c9c Mon Sep 17 00:00:00 2001 From: Dien-Nhung Nguyen Date: Thu, 23 May 2024 10:28:27 +0700 Subject: [PATCH] fix: Crash caused by missing permission on Android 12 (#932) --- .../fossasia/badgemagic/others/BadgeMagicPermission.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/android/src/main/java/org/fossasia/badgemagic/others/BadgeMagicPermission.kt b/android/src/main/java/org/fossasia/badgemagic/others/BadgeMagicPermission.kt index dc0976a2..d9d646b3 100644 --- a/android/src/main/java/org/fossasia/badgemagic/others/BadgeMagicPermission.kt +++ b/android/src/main/java/org/fossasia/badgemagic/others/BadgeMagicPermission.kt @@ -16,9 +16,8 @@ class BadgeMagicPermission private constructor() { val allPermissions = arrayOf( Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.ACCESS_FINE_LOCATION, - Manifest.permission.BLUETOOTH, - Manifest.permission.BLUETOOTH_ADMIN, - Manifest.permission.BLUETOOTH_PRIVILEGED, + Manifest.permission.BLUETOOTH_SCAN, + Manifest.permission.BLUETOOTH_CONNECT, ) val storagePermissions = arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE) @@ -26,9 +25,8 @@ class BadgeMagicPermission private constructor() { val locationPermissions = arrayOf(Manifest.permission.ACCESS_FINE_LOCATION) val bluetoothPermissions = arrayOf( - Manifest.permission.BLUETOOTH, - Manifest.permission.BLUETOOTH_ADMIN, - Manifest.permission.BLUETOOTH_PRIVILEGED, + Manifest.permission.BLUETOOTH_CONNECT, + Manifest.permission.BLUETOOTH_SCAN, ) val ALL_PERMISSION = 100