RL: fix checking for permission

This commit is contained in:
Milos Kozak 2022-03-16 11:36:02 +01:00
parent 97b002eb3c
commit 14641e85e6

View file

@ -160,7 +160,7 @@ class RileyLinkBLE @Inject constructor(
return return
} }
if (config.PUMPDRIVERS && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && if (config.PUMPDRIVERS && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S &&
ContextCompat.checkSelfPermission(context, "android.permission.BLUETOOTH_CONNECT") == PackageManager.PERMISSION_GRANTED ContextCompat.checkSelfPermission(context, "android.permission.BLUETOOTH_CONNECT") != PackageManager.PERMISSION_GRANTED
) { ) {
aapsLogger.debug(LTag.PUMPBTCOMM, "no permission") aapsLogger.debug(LTag.PUMPBTCOMM, "no permission")
return return