public class BluetoothHeadsetUtils
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
BluetoothHeadsetUtils.BlueToothListener |
限定符和类型 | 字段和说明 |
---|---|
private android.media.AudioManager |
mAudioManager |
private android.bluetooth.BluetoothAdapter |
mBluetoothAdapter |
private android.bluetooth.BluetoothHeadset |
mBluetoothHeadset |
private BluetoothHeadsetUtils.BlueToothListener |
mBlueToothListener |
private android.content.Context |
mContext |
private android.content.BroadcastReceiver |
mHeadsetBroadcastReceiver
Handle headset and Sco audio connection states.
|
private android.bluetooth.BluetoothProfile.ServiceListener |
mHeadsetProfileListener
Check for already connected headset and if so start audio connection.
|
private boolean |
mIsOnHeadsetSco |
private boolean |
mIsStarted |
private boolean |
mRegistered |
private static java.lang.String |
TAG |
构造器和说明 |
---|
BluetoothHeadsetUtils(android.content.Context context)
Constructor
|
限定符和类型 | 方法和说明 |
---|---|
boolean |
isOnHeadsetSco() |
void |
start(BluetoothHeadsetUtils.BlueToothListener listener)
Call this to start BluetoothHeadsetUtils functionalities.
|
private void |
startBluetoothSco() |
void |
stop()
Should call this on onResume or onDestroy.
|
private void |
stopBluetoothSco() |
private static final java.lang.String TAG
private android.content.Context mContext
private android.media.AudioManager mAudioManager
private android.bluetooth.BluetoothAdapter mBluetoothAdapter
private android.bluetooth.BluetoothHeadset mBluetoothHeadset
private boolean mIsOnHeadsetSco
private boolean mIsStarted
private boolean mRegistered
private BluetoothHeadsetUtils.BlueToothListener mBlueToothListener
private android.bluetooth.BluetoothProfile.ServiceListener mHeadsetProfileListener
private android.content.BroadcastReceiver mHeadsetBroadcastReceiver
public BluetoothHeadsetUtils(android.content.Context context)
context
- contextpublic void start(BluetoothHeadsetUtils.BlueToothListener listener)
public void stop()
public boolean isOnHeadsetSco()
private void startBluetoothSco()
private void stopBluetoothSco()