FileDocCategorySizeDatePackage
BluetoothPbapRequestPullVcardEntry.javaAPI DocAndroid 5.1 API2589Thu Mar 12 22:22:50 GMT 2015android.bluetooth.client.pbap

BluetoothPbapRequestPullVcardEntry

public final class BluetoothPbapRequestPullVcardEntry extends BluetoothPbapRequest

Fields Summary
private static final String
TAG
private static final String
TYPE
private BluetoothPbapVcardList
mResponse
private final byte
mFormat
Constructors Summary
public BluetoothPbapRequestPullVcardEntry(String handle, long filter, byte format)


           
        mHeaderSet.setHeader(HeaderSet.NAME, handle);

        mHeaderSet.setHeader(HeaderSet.TYPE, TYPE);

        /* make sure format is one of allowed values */
        if (format != BluetoothPbapClient.VCARD_TYPE_21
                && format != BluetoothPbapClient.VCARD_TYPE_30) {
            format = BluetoothPbapClient.VCARD_TYPE_21;
        }

        ObexAppParameters oap = new ObexAppParameters();

        if (filter != 0) {
            oap.add(OAP_TAGID_FILTER, filter);
        }

        oap.add(OAP_TAGID_FORMAT, format);
        oap.addToHeaderSet(mHeaderSet);

        mFormat = format;
    
Methods Summary
protected voidcheckResponseCode(int responseCode)

        Log.v(TAG, "checkResponseCode");

        if (mResponse.getCount() == 0) {
            if (responseCode != ResponseCodes.OBEX_HTTP_NOT_FOUND) {
                throw new IOException("Invalid response received");
            } else {
                Log.v(TAG, "Vcard Entry not found");
            }
        }
    
public com.android.vcard.VCardEntrygetVcard()

        return mResponse.getFirst();
    
protected voidreadResponse(java.io.InputStream stream)

        Log.v(TAG, "readResponse");

        mResponse = new BluetoothPbapVcardList(stream, mFormat);