Class BluetoothHeadsetUtils


  • public class BluetoothHeadsetUtils
    extends java.lang.Object
    This is a utility to detect bluetooth headset connection and establish audio connection.
    • Constructor Detail

      • BluetoothHeadsetUtils

        public BluetoothHeadsetUtils​(android.content.Context context)
        Constructor
        Parameters:
        context - context
    • Method Detail

      • 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.