Fields Summary |
---|
private static final String | TAG |
private static final byte[] | PBAP_TARGET |
static final int | OBEX_SESSION_CONNECTED |
static final int | OBEX_SESSION_FAILED |
static final int | OBEX_SESSION_DISCONNECTED |
static final int | OBEX_SESSION_REQUEST_COMPLETED |
static final int | OBEX_SESSION_REQUEST_FAILED |
static final int | OBEX_SESSION_AUTHENTICATION_REQUEST |
static final int | OBEX_SESSION_AUTHENTICATION_TIMEOUT |
private android.os.Handler | mSessionHandler |
private final javax.obex.ObexTransport | mTransport |
private ObexClientThread | mObexClientThread |
private BluetoothPbapObexAuthenticator | mAuth |
Methods Summary |
---|
public void | abort()
Log.d(TAG, "abort");
if (mObexClientThread != null && mObexClientThread.mRequest != null) {
/*
* since abort may block until complete GET is processed inside OBEX
* session, let's run it in separate thread so it won't block UI
*/
(new Thread() {
@Override
public void run() {
mObexClientThread.mRequest.abort();
}
}).run();
}
|
public boolean | schedule(BluetoothPbapRequest request)
Log.d(TAG, "schedule: " + request.getClass().getSimpleName());
if (mObexClientThread == null) {
Log.e(TAG, "OBEX session not started");
return false;
}
return mObexClientThread.schedule(request);
|
public boolean | setAuthReply(java.lang.String key)
Log.d(TAG, "setAuthReply key=" + key);
if (mAuth == null) {
return false;
}
mAuth.setReply(key);
return true;
|
public void | start(android.os.Handler handler)
Log.d(TAG, "start");
mSessionHandler = handler;
mAuth = new BluetoothPbapObexAuthenticator(mSessionHandler);
mObexClientThread = new ObexClientThread();
mObexClientThread.start();
|
public void | stop()
Log.d(TAG, "stop");
if (mObexClientThread != null) {
try {
mObexClientThread.interrupt();
mObexClientThread.join();
mObexClientThread = null;
} catch (InterruptedException e) {
}
}
|