Code example for Condition

Methods: signal

0
    } 
 
    private void captureDevice(BluetoothDevice device) {
        mDeviceLock.lock();
        mTargetDevice = device;
        mDeviceChangedCondition.signal();
        mDeviceLock.unlock();
 
        if(mReceiver != null) {
            mContext.unregisterReceiver(mReceiver);
            if(mBluetoothAdapter.isDiscovering()) {
                mBluetoothAdapter.cancelDiscovery();
            } 
        } 
    } 
 
    /** Check if a Bluetooth device matches the target address we're looking 
     * for. 
     * 
     * @param device candidate Bluetooth device that's been previously bonded 
     * @param targetAddress Bluetooth MAC addres we're looking for