Code example for BluetoothAdapter

Methods: getProfileProxy

0
	};  
	 
    public BluetoothChatService(Context context, Handler handler) {
        mAdapter = BluetoothAdapter.getDefaultAdapter();
     // Establish connection to the proxy.  
        mAdapter.getProfileProxy(context, mProfileListener, BluetoothProfile.HEADSET);
        mState = STATE_NONE;
        mHandler = handler;
        m_context = context;
        //IntentFilter filter1 = new IntentFilter(BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT); 
        IntentFilter filter1 = new IntentFilter();
      //  filter1.addCategory(BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY + 
       //	      "." + BluetoothAssignedNumbers.PLANTRONICS); 
       /* filter1.addAction(BluetoothDevice.ACTION_ACL_CONNECTED); 
        filter1.addAction(BluetoothDevice.ACTION_ACL_DISCONNECT_REQUESTED); 
        filter1.addAction(BluetoothDevice.ACTION_ACL_DISCONNECTED); 
        filter1.addAction(BluetoothHeadset.ACTION_AUDIO_STATE_CHANGED); 
        filter1.addAction(BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED);*/ 
 
        filter1.addAction(BluetoothHeadset.ACTION_VENDOR_SPECIFIC_HEADSET_EVENT);
        context.registerReceiver(this, filter1);