public class BluetoothHeadsetUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
BluetoothHeadsetUtils.BlueToothListener |
Modifier and Type | Field and Description |
---|---|
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 |
Constructor and Description |
---|
BluetoothHeadsetUtils(android.content.Context context)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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()