Code example for BluetoothClass

Methods: getDeviceClass

                BluetoothClass bluetoothClass = mConnectedHeadset.getBluetoothClass(); 
                if (bluetoothClass != null) 
                    // Check if device is a headset. Besides the 2 below, are there other  
                    // device classes also qualified as headset? 
                    int deviceClass = bluetoothClass.getDeviceClass(); 
                    if (deviceClass == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE  
                        || deviceClass == BluetoothClass.Device.AUDIO_VIDEO_WEARABLE_HEADSET) 
                        // start bluetooth Sco audio connection. 
                        // Calling startBluetoothSco() always returns faIL here,  
                        // that why a count down timer is implemented to call 
                        // startBluetoothSco() in the onTick. 
                        mIsCountDownOn = true; 
                        // override this if you want to do other thing when the device is connected.