if (V) Log.v(TAG, "mLocalShareInfoId = " + mLocalShareInfoId);
if (V) Log.v(TAG, "acquire partial WakeLock");
- if (mWakeLock.isHeld()) {
- mPartialWakeLock.acquire();
- mWakeLock.release();
- }
- mServerBlocking = true;
synchronized (this) {
+ if (mWakeLock.isHeld()) {
+ mPartialWakeLock.acquire();
+ mWakeLock.release();
+ }
+ mServerBlocking = true;
try {
while (mServerBlocking) {
resp.responseCode = ResponseCodes.OBEX_HTTP_OK;
}
- @Override
- public void onClose() {
- if (V) Log.v(TAG, "release WakeLock");
+ private synchronized void releaseWakeLocks() {
if (mWakeLock.isHeld()) {
mWakeLock.release();
}
if (mPartialWakeLock.isHeld()) {
mPartialWakeLock.release();
}
+ }
+
+ @Override
+ public void onClose() {
+ if (V) Log.v(TAG, "release WakeLock");
+ releaseWakeLocks();
+
/* onClose could happen even before start() where mCallback is set */
if (mCallback != null) {
Message msg = Message.obtain(mCallback);
composer = new VCardComposer(mContext, vcardType, true);
composer.addHandler(new HandlerForStringBuffer(op, ownerVCard));
- if (!composer.init(Contacts.CONTENT_URI, selection, null, null)) {
+ if (!composer.init(Contacts.CONTENT_URI, selection, null, Contacts._ID)) {
return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
}
try {
composer = new BluetoothPbapCallLogComposer(mContext, true);
composer.addHandler(new HandlerForStringBuffer(op, ownerVCard));
- if (!composer.init(CallLog.Calls.CONTENT_URI, selection, null, null)) {
+ if (!composer.init(CallLog.Calls.CONTENT_URI, selection, null,
+ CALLLOG_SORT_ORDER)) {
return ResponseCodes.OBEX_HTTP_INTERNAL_ERROR;
}