fix: update CompanionDeviceManager associate() to Activity context

This commit is contained in:
andrekir 2023-04-06 19:10:45 -03:00
parent 4e9ec5f096
commit 2d0d7b3986
3 changed files with 26 additions and 25 deletions

View file

@ -61,7 +61,9 @@ class BluetoothRepository @Inject constructor(
}
fun getBluetoothLeScanner(): BluetoothLeScanner? {
return bluetoothAdapterLazy.get()?.bluetoothLeScanner
return bluetoothAdapterLazy.get()
?.takeIf { application.hasBluetoothPermission() }
?.bluetoothLeScanner
}
@SuppressLint("MissingPermission")