chenhaozhe
2025-07-31 8d211f430259d0ce8001819b08c7d7c8a05fc5c4
plugins/BluetoothTool.js
@@ -181,17 +181,15 @@
      
       //6.0以后的如果需要利用本机查找周围的wifi和蓝牙设备, 申请权限
        if(Build.VERSION.SDK_INT >= 6.0){
         console.log('Build.VERSION.SDK_INT: ',Build.VERSION.SDK_INT);
        }
      let options = this.options
      btFindReceiver = plus.android.implements("io.dcloud.android.content.BroadcastReceiver", {
         "onReceive": function(context, intent) {
            plus.android.importClass(context);
            plus.android.importClass(intent);
            let action = intent.getAction();
            console.log(BluetoothDevice)
            if(BluetoothDevice.ACTION_FOUND == action) { // 找到设备
               let device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
               let newDevice = {
@@ -206,7 +204,6 @@
            }
         }
      });
      let filter = new IntentFilter();
      filter.addAction(BluetoothDevice.ACTION_FOUND);
      filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);