ReviewOS

also looking at this

craft-native/craft

feat(android): the Bluetooth scan pair in Zig — ratchet 56 → 54

#186
Merged glennmichael123 wants to merge feat/android-bluetooth into main
7 files +377 -3
packages/android/templates/CraftBridge.kt.templatemodified+7-0
Changes to packages/android/templates/CraftBridge.kt.template
@@ -2993,6 +2993,11 @@ class CraftBridge(
29932993
29942994 @JavascriptInterface
29952995 fun startBluetoothScan() {
2996 // The ScanCallback object is CraftNative's, and so are the scanner and
2997 // callback fields — which is why stopBluetoothScan has to reach the
2998 // same way, or its own fields stay null and stopScan is never called.
2999 if (CraftNative.startBluetoothScan(activity)) return
3000
29963001 if (ContextCompat.checkSelfPermission(activity, Manifest.permission.BLUETOOTH_SCAN)
29973002 != PackageManager.PERMISSION_GRANTED) {
29983003 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
@@ -3026,6 +3031,8 @@ class CraftBridge(
30263031
30273032 @JavascriptInterface
30283033 fun stopBluetoothScan() {
3034 if (CraftNative.stopBluetoothScan(activity)) return
3035
30293036 bleScanCallback?.let { bluetoothScanner?.stopScan(it) }
30303037 bleScanCallback = null
30313038 }