BlePairRequestReceiver.java
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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();
//
// }
}
}