Package com.alivc.live.pusher
Class BluetoothHeadsetUtils
- java.lang.Object
-
- com.alivc.live.pusher.BluetoothHeadsetUtils
-
public class BluetoothHeadsetUtils extends java.lang.Object
This is a utility to detect bluetooth headset connection and establish audio connection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
BluetoothHeadsetUtils.BlueToothListener
-
Constructor Summary
Constructors Constructor Description BluetoothHeadsetUtils(android.content.Context context)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
checkBluetoothPermissions(android.content.Context context)
Check whether the bluetooth permissions are granted on this device.boolean
isOnHeadsetSco()
void
start(BluetoothHeadsetUtils.BlueToothListener listener)
Call this to start BluetoothHeadsetUtils functionalities.void
stop()
Should call this on onResume or onDestroy.
-
-
-
Method Detail
-
start
public void start(BluetoothHeadsetUtils.BlueToothListener listener)
Call this to start BluetoothHeadsetUtils functionalities.
-
stop
public void stop()
Should call this on onResume or onDestroy. Unregister broadcast receivers and stop Sco audio connection
-
isOnHeadsetSco
public boolean isOnHeadsetSco()
- Returns:
- true if audio is connected through headset.
-
checkBluetoothPermissions
public static boolean checkBluetoothPermissions(android.content.Context context)
Check whether the bluetooth permissions are granted on this device.- Parameters:
context
- android context- Returns:
- true->granted, false->not granted.
-
-