BluetoothPbapRequestPullVcardEntrypublic 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 void | checkResponseCode(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.VCardEntry | getVcard()
return mResponse.getFirst();
| protected void | readResponse(java.io.InputStream stream)
Log.v(TAG, "readResponse");
mResponse = new BluetoothPbapVcardList(stream, mFormat);
|
|