BlePairRequestReceiver.java 1.35 KB
package com.glsx.libble.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * @Package: com.glsx.module_carkey.receiver
 * @ClassName: BlePairRequestReceiver
 * @Company GLSX
 * @Email yangks@didihu.com.cn
 * @Description: 作用描述:
 * @Author: yangks
 * @CreateDate: 2021/4/22 20:12
 * @Version:
 */
public class BlePairRequestReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
//        if (intent.getAction().equals("android.bluetooth.device.action.PAIRING_REQUEST")){
//            // 从Intent中获取设备对象
//            ToolUtils.log_d("------BlePairRequestReceiver PAIRING_REQUEST----");
//            BleDevice bleDevice = CoffeeString.getInstance().getBleDevice();
//            BluetoothDevice bluetoothDevice = bleDevice.getDevice();
//            //开启线程,蓝牙配对绑定
////            new Thread(){
////                @Override
////                public void run() {
////                    if(Build.VERSION.SDK_INT >18){  //版本兼容
////                        bluetoothDevice.createBond();//绑定
////                    }else{
////                        BleBondUtil.createBond(bluetoothDevice);   //绑定
////                    }
////                }
////            }.start();
//
//        }
    }
}