diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-11-15 03:57:19 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-15 03:57:19 -0800 |
commit | 7acb64298b006f48d9396072fe3682e2eaf401e7 (patch) | |
tree | 1adf437f6905637215b1f1bc5c51f555d78d516d | |
parent | 52d19b67986b9004476403b46b5b5d9938489691 (diff) | |
parent | 45f7fd51100ebc26ddef291e715aec243c33b1f0 (diff) | |
download | android_packages_apps_Bluetooth-7acb64298b006f48d9396072fe3682e2eaf401e7.tar.gz android_packages_apps_Bluetooth-7acb64298b006f48d9396072fe3682e2eaf401e7.tar.bz2 android_packages_apps_Bluetooth-7acb64298b006f48d9396072fe3682e2eaf401e7.zip |
Merge "Bluetooth-OPP: Remove OBEX session cleanup from OPP Service"
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppService.java | 29 | ||||
-rw-r--r-- | src/com/android/bluetooth/opp/BluetoothOppTransfer.java | 26 |
2 files changed, 15 insertions, 40 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java index c70a07166..5d1846f62 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppService.java +++ b/src/com/android/bluetooth/opp/BluetoothOppService.java @@ -609,8 +609,20 @@ public class BluetoothOppService extends Service { return; } - if (V) Log.v(TAG, "Batch size= " + mBatchs.size()); - } while ((mBatchs.size() > 0) && mPowerManager.isScreenOn()); + if (V) { + if (mServerSession != null) { + Log.v(TAG, "Server Session is active"); + } else { + Log.v(TAG, "No active Server Session"); + } + + if (mTransfer != null) { + Log.v(TAG, "Client Session is active"); + } else { + Log.v(TAG, "No active Client Session"); + } + } + } while (mPowerManager.isScreenOn() && ((mServerSession != null) || (mTransfer != null))); synchronized (BluetoothOppService.this) { mUpdateThread = null; @@ -822,19 +834,6 @@ public class BluetoothOppService extends Service { if (V) Log.v(TAG," UpdateShare: oldStatus = " + oldStatus + " newStatus = " + newStatus); info.mStatus = newStatus; - if ((!BluetoothShare.isStatusCompleted(oldStatus)) - && (BluetoothShare.isStatusCompleted(newStatus))) { - if (V) Log.v(TAG," UpdateShare: Share Completed: oldStatus = " + oldStatus + " newStatus = " + newStatus); - try { - if((info.mDirection == BluetoothShare.DIRECTION_OUTBOUND) && (mTransfer != null)) { - mTransfer.markShareComplete(newStatus); - } else if (mServerTransfer != null) { - mServerTransfer.markShareComplete(newStatus); - } - } catch (Exception e) { - Log.e(TAG, "Exception: updateShare: oldStatus: " + oldStatus + " newStatus: " + newStatus); - } - } info.mTotalBytes = cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.TOTAL_BYTES)); info.mCurrentBytes = cursor.getLong(cursor .getColumnIndexOrThrow(BluetoothShare.CURRENT_BYTES)); diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java index 55d116f73..acdd188de 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java +++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java @@ -564,31 +564,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch setConfirmed(); } } - public void markShareComplete(int newstatus) { - Log.d(TAG,"markShareComplete: newStatus = " + newstatus); - if (newstatus == BluetoothShare.STATUS_SUCCESS) { - Message msg = Message.obtain(mSessionHandler); - msg.what = BluetoothOppObexSession.MSG_SHARE_COMPLETE; - msg.obj = mCurrentShare; - msg.sendToTarget(); - } else if ((newstatus == BluetoothShare.STATUS_FORBIDDEN) && - Constants.ZERO_LENGTH_FILE) { - /* Mark the status as success when a zero length file is rejected - * by the remote device. It allows us to continue the transfer if - * we have a batch and the file(s) are yet to be sent in the row. - */ - Message msg = Message.obtain(mSessionHandler); - msg.what = BluetoothOppObexSession.MSG_SHARE_COMPLETE; - msg.obj = mCurrentShare; - msg.sendToTarget(); - Constants.ZERO_LENGTH_FILE = false; - } else { - Message msg = Message.obtain(mSessionHandler); - msg.what = BluetoothOppObexSession.MSG_SESSION_ERROR; - msg.obj = mCurrentShare; - msg.sendToTarget(); - } - } + /** * Set transfer confirmed status. It should only be called for inbound * transfer |