Loading src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +4 −2 Original line number Diff line number Diff line Loading @@ -667,8 +667,10 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession { } else if (!mInterrupted && position == fileInfo.mLength) { long endTime = System.currentTimeMillis(); Log.i(TAG, "SendFile finished sending file " + fileInfo.mFileName + " length " + fileInfo.mLength + "Bytes in " + (endTime - beginTime) + "ms" ); + " length " + fileInfo.mLength + " Bytes. Approx. throughput is " + BluetoothShare.throughputInKbps(fileInfo.mLength, (endTime - beginTime)) + " Kbps"); status = BluetoothShare.STATUS_SUCCESS; outputStream.close(); } else { Loading src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java +4 −5 Original line number Diff line number Diff line Loading @@ -384,9 +384,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen values.put(BluetoothShare.FILENAME_HINT, name); if (length != null) { values.put(BluetoothShare.TOTAL_BYTES, length.intValue()); } values.put(BluetoothShare.TOTAL_BYTES, length); values.put(BluetoothShare.MIMETYPE, mimeType); Loading Loading @@ -664,8 +662,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen if (position == fileInfo.mLength) { long endTime = System.currentTimeMillis(); Log.i(TAG, "Receiving file completed for " + fileInfo.mFileName + " length " + fileInfo.mLength + " Bytes in " + (endTime - beginTime) + "ms" ); + " length " + fileInfo.mLength + " Bytes. Approx. throughput is " + BluetoothShare.throughputInKbps(fileInfo.mLength, (endTime - beginTime)) + " Kbps"); status = BluetoothShare.STATUS_SUCCESS; } else { Log.i(TAG, "Reading file failed at " + position + " of " + fileInfo.mLength); Loading src/com/android/bluetooth/opp/BluetoothOppProvider.java +8 −2 Original line number Diff line number Diff line Loading @@ -228,6 +228,13 @@ public final class BluetoothOppProvider extends ContentProvider { } } private static final void copyLong(String key, ContentValues from, ContentValues to) { Long i = from.getAsLong(key); if (i != null) { to.put(key, i); } } @Override public Uri insert(Uri uri, ContentValues values) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); Loading @@ -245,8 +252,7 @@ public final class BluetoothOppProvider extends ContentProvider { copyString(BluetoothShare.DESTINATION, values, filteredValues); copyInteger(BluetoothShare.VISIBILITY, values, filteredValues); copyInteger(BluetoothShare.TOTAL_BYTES, values, filteredValues); copyLong(BluetoothShare.TOTAL_BYTES, values, filteredValues); if (values.getAsInteger(BluetoothShare.VISIBILITY) == null) { filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE); } Loading src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java +1 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ public class BluetoothOppReceiveFileInfo { try { if (metadataCursor.moveToFirst()) { hint = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); mimeType = metadataCursor.getString(2); } } finally { Loading src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public class BluetoothOppSendFileInfo { try { if (metadataCursor.moveToFirst()) { fileName = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); } } finally { Loading Loading
src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +4 −2 Original line number Diff line number Diff line Loading @@ -667,8 +667,10 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession { } else if (!mInterrupted && position == fileInfo.mLength) { long endTime = System.currentTimeMillis(); Log.i(TAG, "SendFile finished sending file " + fileInfo.mFileName + " length " + fileInfo.mLength + "Bytes in " + (endTime - beginTime) + "ms" ); + " length " + fileInfo.mLength + " Bytes. Approx. throughput is " + BluetoothShare.throughputInKbps(fileInfo.mLength, (endTime - beginTime)) + " Kbps"); status = BluetoothShare.STATUS_SUCCESS; outputStream.close(); } else { Loading
src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java +4 −5 Original line number Diff line number Diff line Loading @@ -384,9 +384,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen values.put(BluetoothShare.FILENAME_HINT, name); if (length != null) { values.put(BluetoothShare.TOTAL_BYTES, length.intValue()); } values.put(BluetoothShare.TOTAL_BYTES, length); values.put(BluetoothShare.MIMETYPE, mimeType); Loading Loading @@ -664,8 +662,9 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen if (position == fileInfo.mLength) { long endTime = System.currentTimeMillis(); Log.i(TAG, "Receiving file completed for " + fileInfo.mFileName + " length " + fileInfo.mLength + " Bytes in " + (endTime - beginTime) + "ms" ); + " length " + fileInfo.mLength + " Bytes. Approx. throughput is " + BluetoothShare.throughputInKbps(fileInfo.mLength, (endTime - beginTime)) + " Kbps"); status = BluetoothShare.STATUS_SUCCESS; } else { Log.i(TAG, "Reading file failed at " + position + " of " + fileInfo.mLength); Loading
src/com/android/bluetooth/opp/BluetoothOppProvider.java +8 −2 Original line number Diff line number Diff line Loading @@ -228,6 +228,13 @@ public final class BluetoothOppProvider extends ContentProvider { } } private static final void copyLong(String key, ContentValues from, ContentValues to) { Long i = from.getAsLong(key); if (i != null) { to.put(key, i); } } @Override public Uri insert(Uri uri, ContentValues values) { SQLiteDatabase db = mOpenHelper.getWritableDatabase(); Loading @@ -245,8 +252,7 @@ public final class BluetoothOppProvider extends ContentProvider { copyString(BluetoothShare.DESTINATION, values, filteredValues); copyInteger(BluetoothShare.VISIBILITY, values, filteredValues); copyInteger(BluetoothShare.TOTAL_BYTES, values, filteredValues); copyLong(BluetoothShare.TOTAL_BYTES, values, filteredValues); if (values.getAsInteger(BluetoothShare.VISIBILITY) == null) { filteredValues.put(BluetoothShare.VISIBILITY, BluetoothShare.VISIBILITY_VISIBLE); } Loading
src/com/android/bluetooth/opp/BluetoothOppReceiveFileInfo.java +1 −1 Original line number Diff line number Diff line Loading @@ -113,7 +113,7 @@ public class BluetoothOppReceiveFileInfo { try { if (metadataCursor.moveToFirst()) { hint = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); mimeType = metadataCursor.getString(2); } } finally { Loading
src/com/android/bluetooth/opp/BluetoothOppSendFileInfo.java +1 −1 Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public class BluetoothOppSendFileInfo { try { if (metadataCursor.moveToFirst()) { fileName = metadataCursor.getString(0); length = metadataCursor.getInt(1); length = metadataCursor.getLong(1); if (D) Log.d(TAG, "fileName = " + fileName + " length = " + length); } } finally { Loading