class info
public final class BluetoothBarrier extends Object
车载蓝牙围栏,包括连接、未连接、状态驻留的围栏。

Public Method Summary

Return typeMethod name
AwarenessBarrierpublic static AwarenessBarrier keep(int deviceType, int bluetoothStatus)
AwarenessBarrierpublic static AwarenessBarrier connecting(int deviceType)
AwarenessBarrierpublic static AwarenessBarrier disconnecting(int deviceType)

Public Methods

Method
public static AwarenessBarrier keep(int deviceType, int bluetoothStatus)
车载蓝牙状态驻留围栏,开发者添加连接或非连接两种状态的车载蓝牙状态驻留围栏后,当车载蓝牙状态保持为指定状态时,此围栏状态为TRUE并触发围栏事件上报。

使用此围栏需添加android.permission.BLUETOOTH权限。

Parameters

Parameter nameParameter desc
deviceType车载蓝牙设备类型。
0:标识车载蓝牙设备。
bluetoothStatus车载蓝牙状态。
CONNECTED:车载蓝牙已连接;
DISCONNECTED:车载蓝牙未连接。

Return

Typedesc
AwarenessBarrier情景感知围栏。

Throws

Parameter nameParameter desc
IllegalArgumentException参数不合法(deviceType不是非负整数, bluetoothStatus不是CONNECTED或DISCONNECTED或UNKNOWN)异常。
Method
public static AwarenessBarrier connecting(int deviceType)
车载蓝牙连接围栏,添加此围栏后,当车载蓝牙连接设备时,此围栏状态为TRUE并触发围栏事件上报,5s后状态切换为FALSE。

使用此围栏需添加android.permission.BLUETOOTH权限。

Parameters

Parameter nameParameter desc
deviceType车载蓝牙设备类型。
0:标识车载蓝牙设备。

Return

Typedesc
AwarenessBarrier情景感知围栏。

Throws

Parameter nameParameter desc
IllegalArgumentException参数不合法(deviceType不是非负整数)异常。
Method
public static AwarenessBarrier disconnecting(int deviceType)
车载蓝牙断开连接围栏,添加此围栏后,当车载蓝牙断开连接时,此围栏状态为TRUE并触发围栏事件上报,5s后状态切换为FALSE。

使用此围栏需添加android.permission.BLUETOOTH权限。

Parameters

Parameter nameParameter desc
deviceType车载蓝牙设备类型。
0:标识车载蓝牙设备。

Return

Typedesc
AwarenessBarrier情景感知围栏。

Throws

Parameter nameParameter desc
IllegalArgumentException参数不合法(deviceType不是非负整数)异常。